Skip to content

TheAhmir/vlang-text-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

! CHATGPT GENERATED ROADMAP !

VLang Text Editor Development Roadmap

If you want to build a text editor in VLang, the best approach is to break the project into levels of difficulty so you’re not overwhelmed trying to make a “VSCode clone” right away. You’ll go from a minimal “toy” to something that actually feels usable.

COOL ADDS

  • markdown renderer
  • git integration
  • plain text/ markdown linting
  • v + v-analyzer self contained

Level 0 — Bare Minimum Terminal Editor

🎯 Goal: Display text, let the user type, and quit.

  • Render static text in terminal
    • Use println or term module to output text.
  • Basic input loop
    • Capture keystrokes using os.input() or (better) term.read_key().
  • Quit command
    • Example: Press Esc or Ctrl+Q to exit.

Skills learned: event loop, capturing keyboard input, refreshing the screen.


Level 1 — Editable Text Buffer

🎯 Goal: Let the user insert and delete text in a single buffer.

  • Store text as []string (lines) or []rune (characters).
  • Implement:
    • Typing characters
    • Backspace
    • Enter (newline)
  • Redraw the buffer after every change.
  • Keep track of a cursor position (x, y).

Skills learned: data structures for text storage, cursor tracking, live redraw.


Level 2 — Navigation

🎯 Goal: Move around text with arrow keys.

  • Detect arrow key escape sequences in term.read_key().
  • Update cursor coordinates without going out of bounds.
  • Implement scrolling if the file is bigger than the terminal window.

Skills learned: handling special key codes, viewport management.


Level 3 — File I/O

🎯 Goal: Load and save text files.

  • Use os.read_file() to open a file into your buffer.
  • Use os.write_file() to save changes.
  • Add “Ctrl+S” to save, “Ctrl+O” to open.

Skills learned: basic file handling, encoding considerations (UTF-8).


Level 4 — Quality-of-Life Features

🎯 Goal: Make it slightly pleasant to use.

  • Undo/redo (store edit history).
  • Search (Ctrl+F).
  • Line numbers.
  • Status bar (filename, cursor pos, modified state).

Skills learned: algorithmic thinking for search/replace, small UI elements in terminal.


Level 5 — Going GUI

🎯 Goal: Move away from purely terminal-based editing.

Options:

  • [ui] module in VLang (still experimental, but you can make basic windows and text boxes).
  • Bind to an existing GUI toolkit like SDL2 or raylib.
  • Implement your own rendering in a window using OpenGL (much harder).

Skills learned: event-driven GUIs, rendering text, mouse support.


Level 6 — Advanced Editor Stuff

🎯 Goal: Features that real editors have.

  • Syntax highlighting (parse file by language).
  • Multiple buffers/tabs.
  • Auto-indentation.
  • Plugins or scripting support (mini-REPL in VLang).

Skills learned: text parsing, extensible architecture, performance optimization.


💡 Tips for success

  • Start with terminal-based first — it teaches you buffer management and key handling without GUI headaches.
  • Look at Kilo (C-based terminal editor) for inspiration; you can port concepts to VLang.
  • Keep your rendering function separate from your editing logic — it’ll help when moving to GUI later.
  • Avoid premature optimization; focus on features before speed.

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages