gilvt

Built-in editor

gilvt comes with a general-purpose text editor, so you no longer have to switch to another app to edit a Skill, a command or any other text file.

Opening it. In the Configuration tab, click “View ›” for Skills / commands / subagents, and hover over a row to reveal its “Edit” button; press E (or ⌘O) in a Quick Look preview; or ⌘⇧+click a path in terminal output. If the file is already open in an editor pane, opening it again only focuses that pane instead of opening a duplicate.

Split or new tab. By default it opens as a split to the right of the current terminal pane, so the terminal stays visible. If the current tab already has 3 or more panes, or either side would end up narrower than 60 columns after splitting, it opens in a new tab instead; closing that tab takes you back to the tab you came from. Hold ⌥ (when clicking “Edit” or with ⌥E) to flip this choice.

Editing and saving. Long lines wrap automatically, with the line-number gutter left blank on continuation lines; IME input (e.g. Chinese), mouse selection, undo/redo and Tab / ⇧Tab indentation are supported. ⌘S (or “Save” in the header) saves; while there are unsaved changes, the header and its tab show ●. ⌘⌥O opens the file on disk in an external editor instead (without saving).

KeyAction
⌘SSave
⌘Z / ⇧⌘ZUndo / redo
⌘C / ⌘X / ⌘V / ⌘ACopy / cut / paste / select all
⌘WClose the editor pane
Tab / ⇧TabIndent / outdent
⌥⌫Delete by word
Home / EndFirst to the start / end of the display line, then, pressed again, to the start / end of the whole line

Content is never lost. If, when you save, the file has been changed on disk by another program, a “file was modified on disk” banner appears (Reload / Compare / Overwrite Anyway) instead of silently overwriting. Closing a pane or tab with unsaved content asks whether to save, not save, or cancel; closing a window or pressing ⌘Q lists all unsaved files, where ↩ is “Save All and Close”, Esc cancels, and ⌘↩ closes without saving.

The file changed on disk. An editor pane keeps an eye on its file (for example, when an Agent is editing the same Skill). With no unsaved changes, the new content loads silently and the left side of the status bar briefly flashes “Updated”. With unsaved changes, a yellow banner appears below the header: “The file was modified on disk while you have unsaved changes.”:

  • Reload: replaces the editor content with the disk content. This is a single undoable edit; ⌘Z brings your version back.
  • Compare: opens the compare overlay (see below).
  • Overwrite Anyway: overwrites the disk with your version.
  • Esc only dismisses the banner; a later ⌘S is still stopped, so nothing is quietly overwritten.

When the file has been deleted or moved, the banner reads “The file was deleted or moved.”: Save (re-create) / Close / Dismiss.

The compare overlay. Disk Version on the left, Your Version on the right (merged into a top-to-bottom unified diff when the window is narrow); deleted lines have a red background, added lines a green one, and long unchanged stretches fold into one line that expands on click. If only line endings or encoding differ, it says the content is identical. The overlay reads the disk once when it opens and does not follow later changes. The three buttons at the bottom: Use Disk Version (same as “Reload”, undoable), Keep Mine for Now (only closes the overlay; the banner stays), and Overwrite Disk Anyway (red). Esc returns to editing. This is a text comparison; there is no three-way merge.

Changing encoding, opening read-only. The encoding in the status bar is clickable (for example “GBK ▾”). The menu offers UTF-8, UTF-8 (with BOM), UTF-16 LE / BE, GBK, Shift_JIS, EUC-KR, Big5, windows-1252 and gb18030; picking one rereads the file with it, and the current one is checked ✓. With unsaved changes, it first asks “Discard Changes and Reopen”. The last menu item toggles between “Open as Read Only” and “Open as Editable”; when the file is not writable, or decoding had to replace characters, “Open as Editable” is grayed out. Only an encoding that re-encodes to exactly the file’s bytes can be edited; otherwise the file is read-only, unrepresentable characters show as replacement symbols, and the header is marked “Read only · some characters replaced”.

Rejected files in legacy encodings. When a file is rejected because “the legacy encoding cannot be written back unchanged”, the red banner gains two buttons: “Choose Encoding…” and “Open as Read Only”. Both first open the file read-only in the guessed encoding; the former then pops up the encoding menu, and once you pick an encoding that writes back unchanged, you can edit.

Mixed line endings. When a file mixes several line endings such as LF and CRLF, the line-ending indicator in the status bar shows an amber “LF · Mixed” (saving unifies to this one). Click it to choose LF / CRLF / CR; on save the whole file is written with the chosen line ending. If the file was originally mixed, or the choice differs from the current one, the header shows ● until you save; choosing the current one on a uniform file does not make it dirty. Read-only files cannot change line endings.

Syntax highlighting. Text is colored by file type (Rust, Markdown (including leading YAML front matter), TOML, JSON, Shell and other common languages; colors follow the terminal palette and the light / dark theme). Plain text is not colored and the status bar says “Plain Text”; large files (over 2 MiB or 50,000 lines) are not colored either, and the status bar appends “(not highlighted)” to the language name. Code blocks in Markdown use the code color as a whole and are not colored again by the fence’s language.

Live preview. “Preview ⌘⇧V” in the editor pane header (or just ⌘⇧V) opens a preview pane to the right of the editor pane showing what you are editing, unsaved changes included; it refreshes about 0.2 seconds after you stop typing, and pressing ⌘⇧V again closes it. The preview is read-only; closing either side closes the other, and it is not restored after a restart.

File being editedAvailable previews (the first is the default)
.md / .markdownRendered document (with Mermaid diagrams and local images) · Changes
.mmd / .mermaidRendered diagram · Changes
.svgImage · Changes
Other text filesChanges: the unsaved content compared with the version on disk

With the preview open, the header button reads “Preview: Rendered”, “Preview: Diagram”, “Preview: Image” or “Preview: Changes”; click it to cycle to the next available preview, and when only one is available, clicking it closes the preview. gilvt remembers your choice for each file type. When you scroll the editor or move the cursor, the preview follows to the position matching the editor’s top line (the editor drives the preview, not the other way round). When Mermaid has an error, the source and the error message are shown right in the preview, as in Quick Look; an SVG that cannot be parsed shows “Could not read image”. The “Changes” preview compares against the version on disk at your last edit or save and does not watch the file. For very large files (over 2 MiB or 50,000 lines), the preview is built once when it opens and immediately says “File too large for live preview · updates on save”; after that, typing updates it only when you save. The preview does not respond to Quick Look’s D, S, dropped files or file-link navigation; press Esc to return to the editor.

Files that cannot be edited. Binary files, files over 64 MB, and files in legacy encodings that cannot be written back unchanged are not opened for editing; instead, a red banner at the top of the window explains why, and you can use the preview or an external editor. Files without write permission open read-only; files containing an extremely long line of more than 200,000 characters also open read-only.

Known limitations: in an editor pane, ⌘⇧↑ / ⌘⇧↓ still switch sessions, so you cannot select to the start / end of the document in one keystroke; editor panes are not restored after a restart; there is no find and replace yet.