Editor¶
Voktty's editor is built on CodeMirror 6. It is mounted per editor leaf and remains available when its tab is hidden.
Open and save files¶
Open files from the explorer, command palette or Ctrl+O / Cmd+O. Files are held in LF space internally. Voktty detects the dominant line-ending style and restores it when writing the file.
Saves are conflict-aware. The disk modification time captured at read time is compared with the current file before writing. If the file changed elsewhere, Voktty shows an explicit overwrite choice. It never silently applies last-writer-wins behavior.
Large-file safeguards are deliberate:
- Files over 10 MB require an explicit Open anyway action.
- Files above 50 MB are refused by the hard cap.
- Syntax highlighting and LSP are disabled above the configured large-file threshold to keep memory and latency bounded.
Language support¶
The editor uses a lazy language registry. Common JavaScript, TypeScript, Rust, Python, Go, C/C++, Java, HTML, CSS, JSON and Markdown modes are available without loading every grammar into the eager bundle. Dotenv files use the shell grammar.
Markdown uses GitHub Flavored Markdown behavior, fenced-code highlighting, clickable URLs and task checkboxes. Markdown files can be opened as rendered documents in a separate tab.
Vim mode and editing commands¶
Vim mode is configured from editor settings. CodeMirror owns native history and search panels. Ctrl+F or Cmd+F opens the editor's find and replace panel, and Ctrl+G opens go-to-line when an editor is active.
Formatting¶
Format-on-save uses the external formatter registry. A formatter can be selected globally or overridden per language. Voktty only runs a global default for languages the formatter understands. The disk read-back from a formatter is applied only when the document still matches the save snapshot.
AI completion¶
AI completion can run automatically or manually. The request includes the detected indent unit and the response is normalized for unambiguous tab and space mismatches. Multi-line suggestions render as an inline first line plus a block widget, and Tab accepts an open completion popup before accepting the ghost text.
Use Alt+\\ to trigger AI completion and Ctrl+Space for standard code completion. These shortcuts are guarded to editor tabs so they do not intercept terminal input.
Language servers¶
LSP support is opt-in and session-scoped by server and workspace root. A session starts only when:
- The language is supported by an enabled server preset or custom server.
- The required executable is available.
- The workspace has a recognized root marker.
- An open document needs the server.
Sessions refcount open documents, idle-kill after three minutes and back off after repeated crashes. Diagnostics, definitions, references, completion and formatting depend on the selected server.