zcode is a modern, high-performance TUI (Terminal User Interface) text editor written in Rust.
- Rust toolchain (recommended: the version pinned in
rust-toolchain.toml) - Linux: a C toolchain for linking (e.g.
cc/gcc) (needed for building tree-sitter grammars) - A terminal font with Nerd Font glyphs (recommended for UI icons)
- Optional (for LSP features):
rust-analyzer,gopls,pyright-langserver,typescript-language-server,clangd,jdtls
Run the following command in the project root:
# 1. Open current directory
cargo run
# 2. Open current directory (explicit)
cargo run -- .
# 3. Open a specific file
cargo run -- src/main.rsFor the best performance and smoothest experience (avoiding potential debug-build lag), use release mode:
cargo run --release -- .Build and install zcode to your Cargo bin directory (usually ~/.cargo/bin):
cargo install --path . --locked
zcodeAlternatively, use the helper script:
./install.sh --user
# or: sudo ./install.sh --systemIf you use ./install.sh --user, make sure ~/.local/bin is in your PATH.
Default key mappings are as follows:
-
General:
Ctrl + q: Quit editorCtrl + s: Save current fileCtrl + ,: Open SettingsCtrl + b: Toggle Sidebar visibility
-
Editor:
Ctrl + f: Open Find in fileCtrl + h: Open ReplaceF3/Ctrl + g: Find NextShift + F3/Ctrl + Shift + g: Find PreviousCtrl + \: Split Editor VerticallyCtrl + Shift + \: Close SplitCtrl + Shift + e: Focus ExplorerCtrl + Shift + f: Focus Global Search
-
Tabs:
Ctrl + w: Close current tabCtrl + Tab: Switch to next tabCtrl + Shift + Tab: Switch to previous tab
-
Cursor & Selection:
Ctrl + a: Select AllCtrl + c/x/v: Copy / Cut / PasteCtrl + z: UndoCtrl + y: Redo
-
LSP (when a language server is available):
F2: HoverF12: Go to DefinitionShift + F12: Find ReferencesAlt + Enter: Code ActionCtrl + Space: CompletionCtrl + Shift + r: Rename
zcode has comprehensive mouse support:
- Navigation: Click folders in the Explorer to expand/collapse, double-click files to open.
- Tab Management:
- Left Click: Switch tab.
- Middle Click: Close tab.
- Click 'x': Close tab.
- Splits: Drag the divider between editors to resize splits.
- Cursor: Click anywhere in the editor to move the cursor.
- Fast TUI editor: Built on
ratatuiandcrossterm, featuring a Sidebar, Bottom Panel, Tabs, and split panes. - Multi-language syntax highlighting: Tree-sitter highlight for Rust/Go/Python/JavaScript/TypeScript (incl. JSX/TSX), Java, C, and C++.
- Multi-language LSP support (optional): Diagnostics, hover, completion, go-to-definition, etc, for Rust/Go/Python/JS/TS, Java, C, and C++.
- Monorepo-friendly: LSP root is detected per language by searching the nearest marker file (then spawns per-(language,root)).
- Server discovery: prefers project-local
node_modules/.binand Python virtualenvs when available.
- Search: Built-in
ripgrep-based engine for high-performance global search and real-time in-file finding. - Key Mapping: Flexible keybinding configuration support.
- Clipboard Integration: Seamless system clipboard support.
- Theme Editor: Built-in visual theme editor for customizing syntax highlighting colors. Open via Command Palette (
Ctrl + Shift + p> "Open Theme Editor").- Color Picker: Hue Bar (vertical strip) + Saturation/Lightness palette. Click or drag to pick colors; the code preview updates in real time.
- Auto-save: Color changes are automatically saved to
setting.json(debounced 300ms). No manual save needed. - Keyboard:
Tabto cycle focus (Token List / Hue Bar / SL Palette). Arrow keys to adjust values (Shiftfor larger steps).lto switch preview language.Ctrl + rto reset the selected token to its default color.Escto close. - Mouse: Click or drag on the Hue Bar to change hue. Click or drag on the SL Palette to change saturation/lightness. Click a token in the list to select it.
Settings are stored in:
- Linux:
~/.cache/.zcode/setting.json - macOS:
~/Library/Caches/.zcode/setting.json
You can toggle indent guides in setting.json:
{
"editor": {
"show_indent_guides": true
}
}Set it to false to disable indent guides. showIndentGuides is also accepted.
You can override per-language LSP server command/args and optional initialize options in setting.json:
{
"lsp": {
"servers": {
"rust-analyzer": { "command": "rust-analyzer" },
"gopls": { "command": "/home/you/go/bin/gopls" },
"pyright": { "command": "pyright-langserver", "args": ["--stdio"] },
"tsls": {
"command": "typescript-language-server",
"args": ["--stdio"],
"initialization_options": {
"preferences": {
"includeCompletionsForModuleExports": true
}
}
}
}
}
}For Go, if gopls is installed under ~/go/bin, prefer setting an absolute command path as above.
Install a C toolchain.
- Ubuntu/Debian:
sudo apt install build-essential - Fedora/RHEL:
sudo dnf install gcc - Arch:
sudo pacman -S base-devel
Install one of the following:
- Wayland:
wl-clipboard(wl-copy/wl-paste) - X11:
xcliporxsel
zcode enables LSP by default, but the language servers are optional. Install the servers you want:
-
Rust (
rust-analyzer):rustup component add rust-analyzer rust-src
-
Go (
gopls):go install golang.org/x/tools/gopls@latest
-
Python (
pyright-langserver):npm i -g pyright # or: pipx install pyright -
JavaScript/TypeScript (
typescript-language-server):npm i -g typescript-language-server typescript # or per-project: npm i -D typescript-language-server typescript -
C/C++ (
clangd):Install from your system LLVM/Clang packages (for example
clangdon Debian/Ubuntu). -
Java (
jdtls):Install Eclipse JDT Language Server and ensure
jdtlsis available inPATH.
If you install JS/TS servers per-project, zcode will auto-detect node_modules/.bin (searching upwards from the detected project root).
On macOS Terminal.app, there is a very small chance that mouse input stops working. This is a Terminal.app bug — restarting Terminal usually fixes it.
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-targets --all-featuresGPL-3.0. See LICENSE.
