Code Editor — Liu Terminal

Liu Terminal code editor. A syntax-highlighted editor in the terminal window: explorer rail, 54 lexers across 400+ file types, find and replace, a language-aware status bar and a git diff dock.

A syntax-highlighted editor that lives in the same window as your agents. Open it in the sidebar next to a shell, or give it a whole tab: explorer rail on the left, the document on the right, find and replace, a status bar that knows the language — without leaving the terminal.

Open it

Click any code or text file in the File Browser and it opens in the viewer pane already in edit mode — no separate "edit" step. Markdown is the exception: it opens rendered, with a Read / Edit toggle in its title bar.

⌘ K → Code Editor hands the editor a whole tab instead of the sidebar's narrow strip. The tab opens at the active terminal's working directory; if the sidebar viewer is already holding a document, that document comes with it and the sidebar copy closes, so the same file is never open in two places.

The tab layout

With a document open, the tab lays itself out like a small IDE: the file list docks as a narrow explorer rail on the left and the document takes the rest of the window. Every row in the rail carries a file-type icon, and the tab's pill in the tab bar leads with the same icon next to the filename. Unsaved changes show as an amber dot after the name.

Clicking another file in the rail switches the document. Click inside the text to place the caret; long lines scroll horizontally and the view follows the caret when it leaves the visible columns.

Syntax highlighting

Liu has exactly one highlighter, and three surfaces share it: the editor, the git diff dock and fenced code blocks in the Markdown reader. It is table-driven — one row per language holding its keyword tables, comment tokens and behaviour flags — with 54 lexers behind a table of 400+ file extensions and filenames, so "main.rs" in the editor and a ```rs fence in a note can never disagree.

  • Embedded regions. Vue, Svelte, Astro, HTML, Jinja and ERB files are markup hosts: the <script> inside them is lexed by the JavaScript row and the <style> by the CSS row — the same code that lexes a .js or .css file, not a "JS as seen from a tag" variant. Astro frontmatter, {{ }} / {% %} template tags and <% %> follow the same rule.
  • Cross-line constructs. Block comments (including nested ones), triple-quoted strings and template literals carry their state from line to line, so a comment opened on line 10 is still a comment on line 40.
  • Diffs. A .patch file, or a ```diff fence, is the one language allowed green and red: added and removed lines are the line's meaning.

Find and replace

The find bar floats at the top right of the document and searches as you type: every match is tinted, the current one stronger, and the counter reads "2 of 7". While it is open its keys take priority over the editor's.

  • ⌘ F Open Find
  • ⌘ ⇧ F / ⌘ ⌥ F Open Find & Replace
  • Enter / ⌘ G Next match
  • ⇧ Enter / ⌘ ⇧ G Previous match
  • Tab Switch between the Find and Replace fields
  • Enter In the Replace field: replace this match and move to the next
  • ⌘ Enter Replace all
  • Esc Close the bar; the caret stays on the current match

Editing keys

Shown for macOS; Linux maps ⌘ to Ctrl and ⌥ to Alt. Line commands act on the line under the caret.

  • ⌘ S Save
  • ⌘ Z / ⌘ ⇧ Z Undo / Redo
  • ⌘ V Paste at the caret
  • ⌘ D Duplicate the current line
  • ⌘ C / ⌘ X Copy / cut the current line
  • ⌘ ⌫ Delete to the start of the line
  • ⌘ ← / ⌘ → Start / end of line
  • ⌘ ↑ / ⌘ ↓ Start / end of document
  • ⌥ ← / ⌥ → Move by word
  • ⌥ ⌫ / ⌥ ⌦ Delete the word before / after the caret
  • Tab Insert four spaces
  • PgUp / PgDn Move twenty lines

Status bar

The left end reads the caret position — Ln 42, Col 17 — and the right end the language, the line ending and the encoding: C · LF · UTF-8. The language label comes from the same table that picks the lexer, so ".ts" reads "TypeScript" even though the JavaScript row highlights it; an extension the table does not know is shown upper-cased, and a file with no extension reads "Text". The line ending is measured from the file (CRLF wins when it outnumbers LF). ⌘ S writes to a temporary file and renames it into place, so a crash mid-save can never leave a half-written file.

Git changes

When the active tab sits inside a repository, the status bar's git segment shows the repo, the branch and a +N −M badge. Click it — or run ⌘ K → Toggle Git Changes — and the working tree's whole diff docks on the right. It is the diff and nothing else: a two-column line-number gutter, full-width tinting per row, a card header per file that pins to the top while its rows scroll past, and horizontal scrolling for long lines, because a diff must never wrap. The git call runs on a worker thread, so a cold diff on a large repo never stalls a frame.

Next Markdown viewer →

Documentation

Getting started

Guides

Reference

Other languages

Türkçe · 简体中文 · 한국어 · Español · Deutsch · Italiano · Français · 日本語 · العربية