# croft keybindings
Every action in croft is reachable from the keyboard. Press `F1` inside croft for the same reference, grouped by pane and scrollable.
Per platform:
* **macOS** — the `Cmd` chords below only reach croft after a one-time terminal setup: `croft setup-iterm2` (see [iTerm2 key mappings](#iterm2-key-mappings)) or `croft setup-ghostty` (see [Ghostty key mappings](#ghostty-key-mappings)).
* **Termux/Android** — there is no Cmd key, so `Ctrl` is the command modifier and every `Cmd` chord works as the same chord with `Ctrl`.
* **Touch, no hardware keyboard** — every chord comes through croft's built-in on-screen keyboard: tap the editor, terminal, or Search input to raise it, then tap its one-shot `ctrl` / `alt` keys before a letter (e.g. `ctrl` then `p` opens Quick Open); `⌄` dismisses it.
## Global
| Keys | Action |
|------|--------|
| `Ctrl+s` / `Cmd+s` | Save the open file |
| Typing `(` `[` `{` or a quote | Auto-closing pairs: the pair inserts with the caret between (openers never before a word, quotes never after one); typing the closer steps over; a selection is surrounded; backspace inside an empty pair deletes both. Settings gear → "Auto Closing Pairs" toggles |
| `Ctrl+q` | Quit |
| `F1` | Open the shortcuts modal |
| `F6` | Cycle focus across panes (tree → editor → terminal → tree) |
| `Ctrl+b` / `Cmd+b` | Toggle the primary side bar (left pane) |
| `Opt+Ctrl+b` / `Opt+Cmd+b` | Toggle the secondary side bar (the active file's Outline, on the edge opposite the primary side bar) |
| `Ctrl+j` | Toggle the terminal pane |
| `Ctrl+Shift+j` | Maximize the terminal pane (press again to restore the split) |
| `Cmd+\` | Split the editor into two side-by-side columns; each keeps its own tabs, scroll, and cursor. Closing the last tab in a column collapses the split |
| `Cmd+Opt+←` / `Cmd+Opt+→` | Move focus to the left / right editor group while split (or click a column) |
| `Ctrl+p` / `Cmd+p` | Quick Open: fuzzy-search workspace files and jump to one (auto-reveals it in the Explorer). Add `:236` after the name to land on that line, `:236:7` for a column, or `:236-239` to open with those lines selected. Results are mouse-friendly: click a row to open it, wheel to move the selection, and the same goes for all the quick-pick popups (Command Palette, Go to Symbol, the branch and directory pickers, and the Debug: Attach to Python Process list) |
| `Ctrl+p` / `Cmd+p`, then `#` | Go to Symbol in Workspace: the query goes to every running language server as a `workspace/symbol` search; Enter opens the picked symbol's file at its definition (also Command Palette "Go to Symbol in Workspace") |
| `Ctrl+Shift+p` / `Cmd+Shift+p` | Command Palette: fuzzy-search every named command and run it, with its keybinding shown alongside |
| `Ctrl+Shift+e` / `Cmd+Shift+e` | Jump to the Explorer sidebar |
| `Ctrl+Shift+f` / `Cmd+Shift+f` | Jump to the Search sidebar |
| `Ctrl+Shift+s` / `Cmd+Shift+s` | Jump to Source Control |
| `Ctrl+Shift+b` / `Cmd+Shift+b` | Run the project's build task in a named terminal pane, auto-detected from its manifests (`.vscode/tasks.json`, Makefile, justfile, package.json, Cargo.toml, pyproject.toml). "Tasks: Run Task" and "Tasks: Rerun Last Task" live in the Command Palette |
| `Ctrl+Shift+d` / `Cmd+Shift+d` | Jump to Run and Debug |
| `Ctrl+Shift+r` / `Cmd+Shift+r` | Jump to Remote (SSH) |
| `Ctrl+Shift+x` / `Cmd+Shift+x` | Jump to Extensions |
| `Ctrl+Shift+l` / `Cmd+Shift+l` | While on a remote, disconnect and return to the local croft at the directory you connected from |
| Click a pinned row in the Explorer's sticky band | Scrolled deep in a directory, its ancestor rows pin to the top of the tree; clicking one selects that directory and scrolls it to the top (right-click opens its context menu) |
| Click activity-bar icons | Switch between Explorer, Search, Source Control, Run and Debug, Remote, Extensions, and Testing |
| Click the settings gear | Open settings → Color Theme picker (Croft Black / Croft Dark Blue / Croft Light, a full VS Code Light Modern-style light theme that recolors the whole session including the host terminal, plus ten editor-inspired dark themes: One Dark Pro, Dracula, Monokai, Nord, Gruvbox Dark, Tokyo Night, Catppuccin Mocha, Solarized Dark, GitHub Dark, Darcula) or Customize Layout |
| Click the layout icons (top-right of the editor / welcome) | Toggle the primary side bar, toggle the panel, or open the **Customize Layout** popup |
| Drag a seam | Resize the sidebar, the split between editor columns, or the editor/terminal split |
### `Cmd+K` chords
`Cmd`/`Ctrl`+`K` is a leader (VS Code's two-key model): press it, then a second key within 1.5s. Pressing anything that completes no chord cancels the leader and keeps its normal meaning.
| Keys | Action |
|------|--------|
| `Cmd+K` `Cmd+T` | Open the Color Theme picker |
| `Cmd+K` `G` | Remote: accept the ssh-pane workspace offer. When a pane's foreground becomes `ssh <host>` for a host in `~/.ssh/config`, the status bar says `Connected to <host> · Open workspace here?`; this chord runs the same remote flow as "Remote: Open Workspace on This Pane's Host" for that host, `Esc` dismisses the offer, and it clears itself when the ssh ends or after 90 s. Off globally with `disable_remote_offer`, per host with `remote_offer_excluded_hosts`; a host whose provisioning failed is not offered again for a week |
| `Cmd+K` `Shift+L` | Agent: New Worktree Lane. Asks for a name, cuts a worktree on `agent/<slug>` beside the repo, adds it as a workspace folder and opens a pane named `Lane: <slug>` in it; with `lane_agent` set in settings.json to an `agents.json` row (built in: claude, codex, aider, gemini) the row's `launch` line is typed into that pane, otherwise it is a plain shell and the status says so. The lane comes back on relaunch with its agent seated; its root row in the Explorer wears the branch and the seated agent (`agent/fix-login · ◆ claude ●`); "Agent: Close Worktree Lane" also closes the pane (undoable with `Cmd+K Shift+T`) |
| `Cmd+K` `A` | Session: Participants (who is attached to this persistent session); `Enter` on a row grants/revokes write control or disconnects them |
| `Cmd+K` `Shift+Q` | Session: Detach: leave a persistent session (`croft attach`, `croft remote`) while it keeps running. The attach client catches the chord itself, so a read-only participant or a client of an unresponsive session can always leave, and the shell comes back out of croft's terminal modes |
| `Cmd+K` `X` | Collab: Cancel AI Stream — stop a `croft pair` collaborator streaming into a shared file; the streamed text is reverted (same action as clicking the orange `■` stop button in the editor gutter while a stream is live) |
| `Cmd+K` `N` | Notes: leave a sticky note on the caret line (editor focused). In a `--solo` session every participant sees it under the same line; it follows the line as code moves, takes replies in its box, and its ✕ resolves it. `F4` reaches unresolved notes, the Explorer shows `✎N` per file, and Source Control: Export Comments to Pull Request posts them. Notes: Delete Note removes one |
| `Cmd+K` `Q` | Navigator: ask the resident AI pair programmer about the caret line, or the selected lines when a selection is active (opens the instruction box; also on the gutter and body right-click menus) |
| `Cmd+K` `Y` | Navigator: yield the turn — it reviews the active file comment-only; its remarks land as orange `◆` note diamonds in the gutter and in the Navigator OUTPUT channel |
| PROBLEMS row right-click → **Fix with Navigator** (also the last row of the `Cmd+.` Quick Fix picker when the caret sits on a diagnostic, and the palette's **Problems: Fix With Navigator**) | Navigator: fix that diagnostic. The file opens at the diagnostic and the navigator gets an ask turn naming what was reported, by whom, and where, with the server's own quick fixes as hints; its edit streams into the buffer under its caret, the row wears a spinner until the turn ends, and the server's next publish clears or updates the row. `Cmd+K X` cancels and reverts the streamed text. With no navigator seated the action says so |
| `F4` | Focus the active file's next navigator comment box (wraps, jumping the caret to its line) |
| `Shift+F4` | Ignore the focused navigator comment box (or the next one from the caret) |
| (box focused) type / `Backspace` / `←` `→` | Edit the box's reply draft (the buffer is untouched) |
| (box focused) `Enter` | Send the reply to the navigator (a comment-only turn) |
| (box focused) `Esc` | Leave the box; the keyboard returns to the buffer |
| `Cmd+K` `→` | Close the editor tabs to the right of the active one |
| `Cmd+K` `S` | Select the active file as the compare anchor |
| `Cmd+K` `C` | Diff the active file against the compare anchor |
| `Cmd+K` `W` | Close all editor tabs |
| `Cmd+K` `U` | Close all saved (non-dirty) editor tabs, keeping unsaved ones |
| `Cmd+K` `E` | Reveal the active file in the Explorer tree (expand parents, select, focus) |
| `Cmd+K` `O` | Copy into New Window: open the active file in a new window of your terminal, focused on just the file (Explorer + terminal hidden; the current window is untouched; Ghostty / iTerm2 / Terminal; macOS only) |
| `Cmd+K` `Shift+O` | Move into New Window: same, and close the file's tab here (macOS only) |
| `Cmd+K` `Z` | Toggle Zen Mode: hide the activity bar, both side bars, the panel, and the status bar; press again to restore exactly what was shown before |
| `Cmd+K` `V` | Toggle Live Run for the active Python file: it re-runs on every pause in typing, and each line shows the values it produced, what it printed or returned, and the exception it died with. Line numbers go green for statements that ran and red for ones that never did. Also in the palette as "Python: Toggle Live Run" |
| `Cmd+K` `B` | Show the Testing view (beaker icon); it discovers tests on first open (`cargo test` for Rust, `pytest` for Python). In the view: Enter runs all tests, `r` re-discovers, click a test's play/status glyph to run just it, click its name to jump to its source, click a suite header's play glyph to run the whole suite, click a row's eye to watch that test or suite (it reruns on every save under the project; the header's eye or `w` watches everything), ↑/↓ scroll or drag the scrollbar |
| `Cmd+K` `Enter` | Run the test the editor caret sits in (also in the palette as "Testing: Run Test at Cursor") |
| `Cmd+K` `Shift+Enter` | Debug the test the editor caret sits in: pytest runs as a debugpy module launch under the project's venv, a cargo test binary launches under lldb-dap with the test name as its filter ("Testing: Debug Test at Cursor"); Alt+click a gutter ▷ does the same for that test. When the last run of that test FAILED and named a place in your own code, croft sets a temporary breakpoint at the assertion first, so the session stops where it broke without you finding the line; that breakpoint is removed when the session ends, and a breakpoint you set yourself on the same line is left alone |
| `Cmd+K` `P` | Pin / unpin the active editor tab (moved off `Cmd+K` `Shift+Enter`, which now debugs tests) |
| `Cmd+K` `Shift+P` | Keep the active preview tab open (promote the italic preview to a real tab; moved off `Cmd+K` `Enter`, which now runs tests) |
| `Cmd+K` `H` | Show incoming calls: a picker of everyone calling the symbol at the caret (LSP call hierarchy, one level per invocation; pick a caller and invoke again to walk up) |
| `Cmd+K` `Shift+H` | Show outgoing calls: everything the function at the caret calls, each entry jumping to the callee's definition |
| `Cmd+K` `Shift+U` | Show supertypes: the classes, traits or interfaces the type at the caret extends or implements (LSP type hierarchy; clangd, gopls, jdtls and others) |
| `Cmd+K` `Shift+D` | Show subtypes: the types that extend or implement the one at the caret |
| `Cmd+K` `Cmd+S` | Keyboard Shortcuts editor: every command with its shortcut (yours or the default), searchable. Choose one and press the new chord; croft writes it to `keybindings.json` (keeping your comments) and it works at once. Also in Settings |
| `Cmd+K` `Shift+F` | Open the Search sidebar's query and results as a Search Editor tab (VS Code's `.code-search` layout). Several can stay open at once; `Enter` or `F12` on a result line opens the match |
| `Cmd+K` `Shift+R` | Search Editor: Rerun. Search again for whatever the tab's `# Query:` header now says (flags, includes and excludes too), in the background |
| `Cmd+K` `Shift+G` | Inline AI suggestions on / off. While on, a pause in typing at the end of a line shows the model's suggested continuation as grey ghost text; `Tab` accepts it (recorded as the navigator's writing), `Esc` dismisses it. Uses the workspace's local navigator model when `croft pair` seats one, otherwise the Claude API with `ANTHROPIC_API_KEY` (`CROFT_COMPLETE_MODEL` / `CROFT_COMPLETE_URL` override). Off by default, because it sends code to the model |
| `Cmd+K` `Shift+E` | Run the code lens on the caret line (a menu when there are several). Code lenses are the language server's clickable actions at the end of a symbol's line, such as rust-analyzer's "▶ Run Test" and "⚙ Debug"; click one to run it. "Editor: Toggle CodeLens" in the palette hides them |
| `Cmd+K` `Shift+V` | Open the symbol at the caret in its own tab: the tab shows only that function or class, edits land in the file, and it follows the symbol as the file changes. Also on an OUTLINE row's right-click menu and `Alt+Enter` in Go to Symbol in Workspace |
| `Cmd+K` `M` | Maximize the active terminal pane across the panel width (the other terminals move to a right-edge rail); press again to restore the even split |
| `Cmd+K` `F` | Toggle Format on Save: when on, `Cmd+S` reformats through the language server before writing (also in the Command Palette) |
| `Cmd+K` `Cmd+L` | Toggle the code fold at the cursor: collapse the enclosing block to its header line, or re-expand it. Fold ranges come from the language server (`textDocument/foldingRange`) when it advertises the capability — brace-on-own-line styles, multiline strings, and comment spans fold exactly — falling back to the indentation scan plus `#region` pairs and comment runs when no usable server ranges are available (no reply yet, or an empty one) |
| `Cmd+K` `Cmd+0` | Fold All: collapse every foldable block in the buffer |
| `Cmd+K` `Cmd+J` | Unfold All: expand every collapsed block |
| `Cmd+K` `Cmd+/` | Fold All Block Comments: collapse every comment-kind fold (the server's comment spans, or runs of ≥2 full-line comments in the fallback) |
| `Cmd+K` `Cmd+8` / `Cmd+K` `Cmd+9` | Fold / Unfold All Regions: collapse or expand every `#region … #endregion` pair (`// region` and friends count; nesting pairs innermost-first) |
| Command Palette: `View: Toggle Indent Guides` | Show/hide the editor's indentation guides (vertical lines at each indent level, the cursor's block highlighted; on by default, persisted, also in Settings) |
| Command Palette: `Editor: Toggle Bracket Pair Colorization` | Colour brackets by nesting depth, unmatched closers in red; strings and comments keep plain brackets (on by default, persisted, also in Settings) |
| Command Palette: `View: Toggle Render Whitespace` | Cycle whitespace glyphs (`·` spaces, `→` tabs): selection (default — only inside selected text) → all → none; persisted, also in Settings |
| Command Palette: `Debug: Toggle Inline Values` | While stopped, lines that mention a local — from the paused function's header through the stop — trail its current value (`name = value`), refreshed per stop and cleared on resume (on by default, persisted, also in Settings) |
| Command Palette: `Workspaces: Add Folder to Workspace` | Open the fuzzy directory picker and add the chosen folder as another workspace root: the Explorer shows it as a section, Quick Open / search span it with folder-name prefixes, and its language servers start per folder. Also on any root row's context menu |
| Command Palette: `Workspaces: Remove Folder from Workspace` | Drop the Explorer-selected secondary root folder from the workspace (the primary is the launch identity — use Make Root to change it). Also on a secondary root row's context menu |
| Command Palette: `Workspaces: Save Workspace As` | Write the current folder set as a VS Code-compatible `.code-workspace` file (folder paths relative to the file where possible), at a prompted path |
| Command Palette: `Workspaces: Open Workspace from File` | Apply the active editor's `.code-workspace`: re-root to its first folder and install its folder set exactly. `croft project.code-workspace` opens one from the CLI |
| Mouse wheel | Scroll the pane under the pointer |
### Customize Layout
Click the **⛶** icon at the top-right of the editor (or the welcome screen), or the settings gear → **Customize Layout**. The popup mirrors VS Code's title-bar layout controls and stays open while you flip several toggles:
| Group | Options |
|-------|---------|
| Visibility | Activity Bar, Primary Side Bar (`Cmd`/`Ctrl`+`B` — but bare `Ctrl`+`B` goes to the app while the terminal pane is focused, so Claude Code's backgrounding works; `Cmd`+`B` always reaches croft), Secondary Side Bar (`Opt`+`Cmd`/`Ctrl`+`B`), Panel (`Ctrl`+`J`), Status Bar, Minimap (`Opt`+`Cmd`/`Ctrl`+`M`) |
| Auto-Hide Side Bar | Off by default. On, the primary side bar collapses when focus moves to the editor or a terminal (also on the palette as **View: Toggle Auto-Hide Side Bar**). A reveal you asked for - `Cmd`/`Ctrl`+`B`, the activity bar, this row - is exempt from the next collapse. See [LAYOUT.md](LAYOUT.md#auto-hide-side-bar) for everything that holds it open. |
| Primary Side Bar Position | Left / Right (moves the activity bar with it) |
| Panel Alignment | Left / Center / Right / Justify (Justify spans the full width under the side bar) |
| Quick Input Position | Top / Center (where Command Palette / Go to File appears) |
| Zen Mode | `Cmd`/`Ctrl`+`K` `Z` |
Every choice except the side-bar / panel visibility persists across launches in `~/.config/croft/config.json`.
## Command Palette
`Cmd`/`Ctrl`+`Shift`+`P` opens the Command Palette: type to fuzzy-search every named command, `↑`/`↓` to move, `Enter` to run, `Esc` to close. Every command carries a chord and shows it on the right, so the palette is both a second way to reach commands and a discovery surface for their accelerators.
| Command | Chord | Action |
|---------|-------|--------|
| Debug: Select and Start Debugging | palette only | Pick a `launch.json` configuration (or the zero-config "Debug active file" entry) and start it; the pick becomes what `F5` and restart launch. Compounds are listed; selecting one launches every configuration it names, one debug session each |
| Debug: Add Configuration… | palette only (also the last row of the picker above) | Build a configuration without editing JSON: pick the debugger (Python, Rust / C / C++, Go, JavaScript / TypeScript), launch or attach, then answer one prompt per field — name, program, arguments, working directory, environment and pre-launch task to launch; port (Python, Node) or process id (lldb, delve) to attach. Enter on a blank optional field skips it, and a value that does not fit is refused with the reason and offered back to fix. The entry is added to `.croft/launch.json` (created if needed) and selected, so `F5` starts it |
| Debug: Restart | `Shift`+`Cmd`+`F5` | Restart the active debug session |
| Debug: Add Conditional Breakpoint | `Shift`+`F9` | Add or edit a conditional breakpoint at the cursor |
| Debug: Add Logpoint | `Shift`+`Alt`+`F9` | Add or edit a logpoint at the cursor: the adapter prints the message (`{expr}` interpolates) instead of pausing |
| Debug: Toggle Break on Raised Exceptions | `Alt`+`F9` | Break on raised (not just uncaught) exceptions |
| Debug: Attach to Python Process | `Ctrl`+`F5` | Pick a running CPython 3.14+ process and drop a `pdb` REPL into it (PEP 768 `sys.remote_exec`); the debugger runs in a croft terminal, elevating with `sudo` when the OS requires it |
| Preferences: Color Theme | `Cmd`+`K` `Cmd`+`T` | Pick the active color theme (also via the settings gear) |
| Session: Participants | `Cmd`+`K` `A` | List who is attached to this multiplayer session (docs/MULTIPLAYER.md); pick a participant to grant/revoke write control or disconnect them. The status bar shows an "N attached" badge whenever someone else is on |
| Session: Detach | `Cmd`+`K` `Shift`+`Q` | Detach this client from the persistent session; the session keeps running. Run the same `croft attach` / `croft remote` command to reattach |
**Terminal: Search & Replace from Last grep/rg** (palette-only) reads the last `grep`/`rg`/`git grep` command run in the focused terminal, seeds the Search sidebar with its pattern and matching flags (`-i`, `-w`, `-F`/`-E`, `-g`), and runs it. The terminal search becomes the Search panel's results list, so its replace-all covers every match at once (`:cdo`-style).
## Settings, custom keybindings & snippets
All three live under `~/.config/croft/` (XDG-resolved, so the same paths on macOS and Linux) and are reachable from the Command Palette. Opening one that doesn't exist yet seeds it with a working example.
| Command | Opens | Notes |
|---------|-------|-------|
| Preferences: Open Settings | a searchable settings hub | Fuzzy-search the toggleable settings; `Enter` flips a toggle and keeps the hub open. Also routes to the Color Theme picker and the JSON files below |
| Preferences: Open Settings (JSON) | `config.json` | The full preferences document; edits apply on the next launch |
| Preferences: Open Keyboard Shortcuts (JSON) | `keybindings.json` | Rebind any palette command; **applies on save** |
| Preferences: Configure User Snippets | `snippets.json` | Define snippets; **applies on save** |
**Custom keybindings.** `keybindings.json` is a JSON (with `//` comments) array of `{ "key": …, "command": … }`:
* `key` is a chord like `ctrl+shift+p`, `cmd+,`, `alt+up`, or `f2`. Modifiers are `ctrl`, `alt`/`opt`, `shift`, `cmd`/`super`, and `mod` (Cmd on macOS, Ctrl elsewhere).
* `command` is a palette command id (see the ids in `Preferences: Open Settings`, e.g. `save_file`, `quick_open`, `toggle_terminal`).
* A bound chord wins over the built-in default for the same chord.
These restrictions cover KEYBOARD chords only. They apply while any pane except the terminal is focused, and only to chords that carry a modifier or are function keys, so plain typing and the terminal's control keys are never shadowed. Mouse gestures bind in the same file under different rules — they reach the terminal, and a bare gesture is allowed where it collides with nothing (see [Mouse bindings in `keybindings.json`](#mouse-bindings-in-keybindingsjson) below).
In iTerm2, reserved `Cmd` chords must be forwarded first (`croft setup-iterm2`); `Ctrl`/`Alt`/function-key bindings always reach croft, and Ghostty forwards everything after `croft setup-ghostty`.
**User snippets.** `snippets.json` mirrors VS Code's global snippets file: an object keyed by a name, each with a `prefix`, a `body` (a string or an array of lines), and an optional `scope` (comma-separated language ids; omit for every language). Type a snippet's prefix and press `Tab` to expand it, or pick it from the completion popup, where it appears alongside language-server suggestions and is accepted with `Enter`/`Tab`.
The body uses VS Code tab-stop syntax: `$1`, `$2`, … are stops visited in order with `Tab`, `$0` is the final caret, and `${1:name}` seeds a stop with selected placeholder text. Continuation lines are re-indented to the caret. Language-server completions that arrive as snippets (rust-analyzer's `println!` and the like) expand the same way.
## Explorer (file tree)
| Keys | Action |
|------|--------|
| `↑` / `↓` | Move selection |
| `Enter` | Open a file and move the keyboard into the editor, so the new tab's own navigation keys work straight away (VS Code parity); on a folder, expand or collapse it |
| `→` | Preview a file without leaving the tree, so `↑`/`↓` keep walking the list; on a folder, expand it |
| Click a file | Open it in the replaceable preview tab and move the keyboard into the editor, so the tab's own navigation keys (PDF pages, spreadsheet rows) work at once; double-click pins the tab. Clicking a folder just expands it and keeps focus in the tree |
| `←` | Collapse a folder |
| `Shift`+`↑` / `↓` / `PageUp` / `PageDown` / `Home` / `End` | Extend multi-selection from the anchor row |
| `Shift`+click | Extend multi-selection across a range |
| `Alt`/`Option`+click or `Ctrl`+click | Toggle a single row in or out of the selection |
| `Ctrl`+`A` / `Cmd`+`A` | Select every visible row |
| `Esc` | Clear the multi-selection |
| `Ctrl`+`C` / `Cmd`+`C` | Copy selected paths to the explorer clipboard |
| `Ctrl`+`X` / `Cmd`+`X` | Cut selected paths |
| `Ctrl`+`V` / `Cmd`+`V` | Paste into the focused folder (move on Cut, copy on Copy) |
| `Cmd`+`Z` | Jump to a directory via zoxide: a fuzzy popup over your frecency-ranked dirs, then re-roots the workspace and `cd`s the terminal. Shares one database with the shell's `j` command; croft installs zoxide and wires the shell hook on first launch if needed |
| Drag a row onto a folder | Move the selection into it (`Alt`-drag to copy instead) |
| `Delete` / `Backspace` / `Cmd`+`Backspace` | Move every selected path to the OS Trash (after a confirmation popup — `Enter` to trash, `Esc` to keep) |
| `Cmd`+`Opt`+`R` (local macOS only) | Reveal the selected entry in Finder |
| Right-click | Context menu: Cut, Copy, Paste, Rename, Delete, Reveal in Finder (local macOS), and New File / New Folder on empty space |
| Click the Explorer root-folder icons | New File, New Folder, Refresh Explorer, and Collapse Folders, right-aligned on the root folder row and shown only while the Explorer is focused, mirroring VS Code's workspace-folder actions (New File / New Folder also on `Cmd+F` / `Cmd+Shift+N`) |
| Click the `⋯` button on the EXPLORER title line | Open the "Views and More Actions" menu: toggle which sub-views stack in the Explorer (Open Editors, Folders, Outline, Timeline, and a language-aware Dependencies view that only appears when the workspace root has a recognized manifest), each with a checkmark when shown. Choices persist across launches |
| Click a row in OPEN EDITORS | Activate that editor's tab (dirty tabs show a dot, the active tab is highlighted) |
| Click a commit in TIMELINE | Open that commit's diff for the active file in a read-only editor tab |
| Click a local snapshot in TIMELINE | croft snapshots every save into local history; the TIMELINE lists those snapshots alongside git commits. Click one to diff it against the working file |
| Command Palette: `Local History: Restore Snapshot` | Write the snapshot shown in the open TIMELINE diff back over the working file |
## Search sidebar
| Keys | Action |
|------|--------|
| Type | Live `.gitignore`-aware workspace search, per keystroke (off the UI thread; every match is returned, no cap). Unsaved buffers are searched in-memory, so unsaved edits are findable before you save |
| Click `Aa` / `ab` / `.*` (inset at the right of the search field) | Toggle case-sensitive / whole-word / regex; active toggles show an accent chip |
| Click the header refresh icon | Re-run the current query |
| Click the header clear icon | Clear the search query and results |
| Click the left chevron (`▸`/`▾`) | Expand / collapse the Replace row (expanding focuses it); while a replacement is typed, every result row previews the match crossed out with the expanded replacement beside it |
| Type in Replace, then `Enter` or click the replace-all icon | Raise the Replace All confirmation — "Replace N occurrence(s) across M file(s)?" — then `Enter`/`Y` rewrites on disk, `Esc` cancels (regex mode honours `$1` capture references); files open with unsaved changes are skipped and named, and the search re-runs afterward |
| Click the `...` icon | Expand / collapse the "files to include" and "files to exclude" glob inputs |
| Type globs into include / exclude | Restrict the search to / from matching files (comma-separated, VS Code style; a bare `*.rs` matches at any depth). Editing re-runs the search live |
| `Tab` | Cycle focus through the visible inputs (search → replace → include → exclude) |
| `↑` / `↓` + `Enter`, or click a result | Open the file at the matched line in the replaceable preview tab |
| Double-click a result | Pin its tab, so moving to the next result opens beside it instead of replacing it |
## Source Control sidebar
| Keys | Action |
|------|--------|
| Type in the message box | Edit the commit message (the box scrolls horizontally when the message outgrows it) |
| `Enter` | Commit all tracked changes with the message |
| Click ✓ Commit | Same as `Enter` |
| Click a change row | Open that file's diff against HEAD in a read-only editor tab |
| `S` in a diff tab | Stage only the change hunk under the cursor (click a row or `F7` to pick the hunk). With a selection dragged across rows, stages only the SELECTED lines instead (VS Code's Stage Selected Ranges): unselected additions stay out of the index and unselected deletions stay in it |
| `U` in a diff tab | Unstage only the change hunk under the cursor, or only the selected lines when a selection spans rows |
| `R` in a diff tab | Revert only the change hunk under the cursor after a `Y`/`N` confirm modal |
| `F7` / `Shift`+`F7` in a diff tab | Jump to the next / previous change hunk |
| Command Palette: `Git: Toggle Inline Blame` | Show/hide the GitLens-style current-line blame annotation (author, age, summary trailing the cursor's line; on by default, persisted) |
| Command Palette: `Editor: Toggle Provenance` | Show/hide who typed each line: a bar in the gutter lane coloured per seat (you, navigator, agent, peer, generated) and the seat's name on the inline-blame annotation (which needs `Git: Toggle Inline Blame` on); lines with no record show nothing, and conflict blocks keep their [Accept …] actions. Off by default, session-only |
| Command Palette: `Diff: Toggle Group by Seat` | In a Source Control diff of the working tree, mark who wrote each line the change ADDS: a bar in the right gutter in that seat's colour, and a per-seat tally in the diff header, so a change reads as "the agent's part" and "my part". Lines with no record are counted as `unrecorded` and painted nothing. Unchanged lines are not marked: their seat describes earlier work. Off by default, per-view |
| `Cmd`+`A` / `Ctrl`+`A`, then `Cmd`+`S` / `Ctrl`+`S` | Select every change, then stage the selection |
| Click `+` on a selected unstaged row | Stage that file |
| Click `↶` on a selected unstaged row | Discard that file (confirms first; deletes untracked files) |
| Click `−` on a selected staged row | Unstage that file |
| Click the branch name | Open the Checkout / Create Branch picker: type to filter branches, `↑`/`↓` to navigate, `Enter` to switch — or type a new name and `Enter` to create and switch to it |
| Click the `▾` caret next to Commit | Open the quick actions menu: Commit & Push, Push, Pull, Sync (Pull, Push), Checkout / Create Branch, Stash, Pop Stash, View Staged Changes, View Changes vs previous, View Changes vs `<default>` |
| Click the `⋯` icon in the header | Open the full Source Control actions menu (VS Code's title menu) with fly-out submenus: Pull · Push · Clone · Checkout to · Fetch · **Commit ›** (Commit, Commit Staged, Commit All, Amend, Commit & Push, Commit & Sync) · **Changes ›** (Stage All, Unstage All, Discard All) · **Pull, Push ›** (Sync, Pull Rebase, Push to, Push Force, Publish Branch) · **Branch ›** (Create, Create from, Rename, Delete, Merge, Rebase) · **Remote ›** (Add, Remove) · **Stash ›** (Stash, Include Untracked, Stash Staged, Apply, Pop Latest, Pop, Drop) · **Tags ›** (Create, Delete) · Show Git Output. Click a submenu row to fly it out; ops needing a value (clone URL, branch name, tag name, remote) open an input modal, ops choosing one of a list (apply/drop a stash, delete a tag, remove a remote) open a picker; `Esc` closes |
| Discard All Changes | Reverts every tracked file to HEAD after a `Y`/`N` confirm modal (untracked files are kept) |
| Click the header refresh icon | Force an immediate git re-scan |
## Editor: text
| Keys | Action |
|------|--------|
| Arrows, Home, End | Navigate (clears any selection) |
| `Shift`+arrows / `Home` / `End` / `PageUp` / `PageDown` | Extend the selection by the same motion |
| `Shift`+`Alt`+`→` / `Shift`+`Alt`+`←` | Expand / Shrink Selection (VS Code's smart select): grow every cursor to the next semantically meaningful range and retrace back exactly. Ranges come from the language server (`textDocument/selectionRange`, one request covering all cursors) when it advertises the capability, else from tree-sitter node ancestry — so the gesture works with no LSP at all; a plain-text file grows line → buffer. Any edit, click, or caret change restarts the gesture |
| `PageUp` / `PageDown` (`fn`+`↑` / `fn`+`↓` on Mac) | Scroll one viewport |
| Two-finger horizontal swipe, or drag the bar | Pan long lines in code files; the cursor pans the view when it passes either edge |
| Markdown soft-wrap | Markdown files wrap long lines onto the next visual row (no horizontal scrollbar); `↑`/`↓` move by visual row |
| Printable char, Enter, Backspace, Delete | Edit (typing or deleting with a selection replaces it) |
| Typing inside a paired tag | Linked editing (`textDocument/linkedEditingRange`, servers like vtsls / html-language-server): editing one HTML/JSX tag name renames its pair live; one Undo reverts both together. The link drops the moment the caret leaves the tag or the edit stops looking like a tag name (space, `>`, newline) |
| `Tab` | Indent: a multi-line selection indents every touched line one level; otherwise inserts to the next tab stop. The stop width and tabs-vs-spaces are detected from the file's own content on open (VS Code's `editor.detectIndentation`), falling back to the language default (4, or 2 in YAML); the status bar's indent pill shows the result and clicking it overrides both |
| `Shift`+`Tab` | Outdent one level, tab-stop aligned, for the current line or every line a selection touches |
| `Alt`+`↑` / `Alt`+`↓` | Move the current line (or selected block) up / down, carrying the cursor and selection |
| `Shift`+`Alt`+`↑` / `↓` | Copy the current line (or selected block) up / down |
| `Cmd`/`Ctrl`+`Opt`+`↑` / `↓` | Add a cursor above / below the current one (multi-cursor) |
| `Cmd`+`/` / `Ctrl`+`/` | Toggle line comment for the current line or every line the selection touches (language-aware; comments at the block's common indent) |
| `Shift`+`Alt`+`A` | Toggle block comment around the selection (languages with a block comment) |
| `Alt`+`Z` | Toggle soft word wrap for this file (overrides the per-language default until the file is reopened) |
| `Cmd`/`Ctrl`+`Shift`+`V` | Markdown: Toggle Preview — flip the active Markdown tab between its source and the rendered view (headings, emphasis, lists, quotes, tables, links, and fenced code blocks with the editor's own syntax colours). Arrows / PgUp / PgDn / Home / End / wheel scroll the preview; the same chord returns to the source. The preview opens at the part of the document the source was showing and returns there; with the source and the preview side by side in a split, the other pane follows as you scroll (also Command Palette "Markdown: Toggle Preview") |
| `Cmd`+`Shift`+`\` | Go to Bracket: jump the cursor to the matching bracket. From an opening bracket it lands on its close (and vice versa); from inside a pair it lands on the enclosing close |
| `Cmd`+`Opt`+`\` | Select to Bracket: select the region between the matching brackets, including the brackets themselves |
| `Ctrl`+`T` | Transpose Characters: swap the character before the cursor with the one after it and step right; at the end of a line the last character moves across the line break |
| `Cmd`+`Opt`+`Shift`+`S` | Convert Indentation to Spaces: replace each tab in every line's leading indentation with one tab width of spaces (4, or 2 in YAML) |
| `Cmd`+`Opt`+`Shift`+`T` | Convert Indentation to Tabs: replace each leading run of one tab width of spaces with a tab, leaving any remainder |
| `Cmd`+`Opt`+`Shift`+`N` | Trim Final Newlines: drop trailing blank lines at the end of the file (always keeping at least one line) |
| `Cmd`+`Opt`+`Shift`+`J` | Join Lines: collapse the selected lines (or the current line with the next) into one, single-spaced |
| `Cmd`+`Opt`+`Shift`+`U` / `L` / `C` | Transform the selection (or the word under the cursor) to Uppercase / Lowercase / Title Case |
| `Cmd`+`Opt`+`Shift`+`A` / `D` | Sort the selected lines (or the whole file) Ascending / Descending |
| `Cmd`+`Opt`+`Shift`+`W` | Trim Trailing Whitespace: strip trailing spaces and tabs from every line |
| `Cmd`+`Opt`+`Shift`+`F` | Format Document: reformat the whole buffer through the language server (rustfmt, ruff, prettier, …); the edit lands as one undo step and leaves the tab dirty |
| `Cmd`+`K` `Cmd`+`F` | Format Selection (`textDocument/rangeFormatting`): reformat only the selected span through the language server, same one-undo-step application as Format Document. Needs a selection; refuses with guidance otherwise. Plain `Cmd`+`K` `F` (without the second `Cmd`) keeps croft's Format-on-Save toggle |
| Command Palette "Change Color Presentation" | With the caret on a color value (the `■` swatch cells mark them, painted in the value's own color via `textDocument/documentColor`): pick an alternative spelling (`#rrggbb`, `rgb()`, `hsl()`, …) from the server's `colorPresentation` offerings; the pick applies the server's edit as one undo step. The swatch decoration follows the css-language-server family; languages without a colorProvider never show it |
| Command Palette "Preferences: Toggle Format on Type" | VS Code's `editor.formatOnType` (off by default): when on, typing one of the server's advertised trigger characters (per its `documentOnTypeFormattingProvider` — rust-analyzer advertises `=`, `.`, `>`, `{`) quietly runs the server's on-type formatter at the caret. A reply landing after further edits is dropped rather than applied stale; nothing is ever requested for a language whose servers advertise no triggers. Also in Settings |
| `Cmd+K` `F` | Toggle Format on Save: when on, `Cmd+S` formats through the language server before writing (off by default, matching VS Code) |
| Click a breadcrumb symbol | The breadcrumbs bar above the editor shows the file path and the enclosing symbol trail at the caret; clicking a symbol crumb jumps to it |
| Click a sticky-scroll header | Sticky scroll pins the enclosing scope headers (class, function) to the top while you scroll; clicking one jumps to that line |
| Click the gutter fold chevron | Toggle the fold on that line: a `▾` marks an expanded foldable block (a function, loop, struct — any line whose body is more indented), a `▸` marks a collapsed one. Also on `Cmd+K` `Cmd+L` at the cursor, and Command Palette "Toggle Fold" / "Fold All" / "Unfold All" |
| Arrow keys over a fold | Up and Down step over a collapsed block rather than into it; an edit that lands inside one (from search, Go to Definition or Go to Line) opens it, so typing never changes lines you cannot see |
| Mouse drag | Select text; every other occurrence of a single-line selection highlights in blue |
| `Ctrl`+`C` / `Cmd`+`C` | Copy the selection to the system clipboard |
| `Cmd`+`Opt`+`C` / `Ctrl`+`Opt`+`C` | Copy Path: put the active file's absolute path on the system clipboard (also on the editor tab right-click menu) |
| `Ctrl`+`X` / `Cmd`+`X` | Cut the selection |
| `Ctrl`+`V` / `Cmd`+`V` | Paste at the cursor (replaces any selection) |
| `Ctrl`+`Z` / `Cmd`+`Z` | Undo (typing bursts coalesce; backspace, paste, cut, replace are each one step) |
| `Shift`+`Ctrl`+`Z` / `Shift`+`Cmd`+`Z` | Redo the most recently undone step; a fresh edit after an undo discards the redo branch (also Command Palette "Redo") |
| `Cmd`+`A` | Select the entire buffer |
| `Ctrl`+`f` / `Cmd`+`f` | Inline Find bar: pre-filled from the selection or word under the cursor; active match in orange, the rest in yellow; `Enter`/`F3` forward, `Shift+Enter`/`Shift+F3` back, `Esc` closes |
| `Ctrl`+`Alt`+`f` / `Cmd`+`Opt`+`f` | Replace in File: the Find bar expanded with a replace row; `Tab` switches field, `Enter` in the replace row replaces the current match and advances, `Cmd`+`Opt`+`Enter` (`Ctrl`+`Alt`+`Enter` on Linux) replaces all as one undo step; `$1` capture references work in regex mode |
| `Ctrl`+`A` / `Ctrl`+`E` | Move to start / end of line |
| `Ctrl`+`K` / `Ctrl`+`U` | Kill to end / start of line (yanks to clipboard) |
| `Cmd`+`o` / `Cmd`+`Shift`+`Enter` | Open a new line below / above, inheriting indent |
| `Ctrl`+`Shift`+`o` / `Cmd`+`Shift`+`O` | Go to Symbol in Editor: fuzzy-search the file's symbols and jump (type `:` then a number to go to a line) |
| `Cmd`+`g` `g` | Go to the top of the file (`Cmd`+`N` `Cmd`+`g` `g` for line N) |
| `Cmd`+`Shift`+`G` | Go to the bottom of the file (with a leading count, that line) |
| `Cmd`+`Shift`+`K` / `Ctrl`+`Shift`+`K` | Delete Line: remove every line touched by a cursor or its selection, so it composes with the extra cursors `Cmd`+`D` and `Opt`+click create; yanks to clipboard |
| `Cmd`+`y` `y` | Yank the current line (`Cmd`+`N` `Cmd`+`y` `y` for N lines) |
| `Cmd`+`D` / `Ctrl`+`D` | Add Selection to Next Find Match: select the word under the cursor, then grow the multi-cursor one occurrence per press |
| `Option`+click | Add (or toggle off) a secondary caret at the click |
| `Shift`+`Option`+drag | Column (box) selection: one caret per spanned row |
| `Cmd`+`F2` / `Ctrl`+`F2` | Change All Occurrences of the word under the cursor at once |
| `Esc` | Clear the selection, or collapse multi-cursors back to one |
| `Cmd`+`.` / `Ctrl`+`.` | Quick Fix: ask the language server for the code actions at the cursor (auto-import, fix-all, organize imports, refactors) and pick one from a menu; the diagnostics on the line ride along as context. One action with a deferred edit resolves and applies on pick (`codeAction/resolve`); also on the editor right-click menu and as Command Palette "Quick Fix"|
| `Cmd`+`Enter` / `Ctrl`+`Enter` (in a `.http`/`.rest` file; iTerm2 maps `Cmd+Enter` to fullscreen and never delivers it, so use `Ctrl+Enter` there) | Send the request under the caret (REST Client's format: requests separated by `###`, `{{variables}}` filled from a `.http.env.json` beside the file or `{{$env.NAME}}`; a variable with no value refuses to send). The response opens as a tab — status, timing, and headers as comments, JSON pretty-printed, images rendered — and the request lands in command history with its variables **unresolved**, so secrets stay in the env file. The palette carries **HTTP: Send Request Under Caret** and **HTTP: Copy Request as curl** |
| `Cmd`+`.` / `Ctrl`+`.` inside a merge conflict | Resolve Merge Conflict picker: Accept Current / Accept Incoming / Accept Both (also Command Palette "Merge Conflict: Accept Current / Incoming / Both"); conflict regions render with VS Code's green (current) / blue (incoming) tints, and each conflict's header row carries clickable `[Accept Current] [Accept Incoming] [Accept Both]` actions |
| `F7` / `Shift`+`F7` in a buffer with conflicts | Jump to the next / previous conflict, wrapping (the status counts "Conflict k of n"); clicking a MERGE CONFLICTS entry in Source Control opens the three-way merge editor (below), with the marker flow one "Reopen as Text" away |
| Command Palette "Merge Conflict: Accept All Current / Incoming" | Resolve every block in the file one way |
| Command Palette "Merge: Complete Merge (stage file)" | Once zero conflicts remain: save the buffer and stage the file, moving it from MERGE CONFLICTS into the ordinary staged flow; refuses while blocks are unresolved |
| Command Palette "Merge: Open Merge Editor" | Three-way merge editor on the active file: Current and Incoming panes above an editable Result (the real buffer — LSP, undo, and save all apply), sourced from the git index stages or synthesized from the file's conflict markers. Non-overlapping edits pre-resolve into the Result; only truly overlapping hunks remain as conflicts. `F7`/`Shift`+`F7` hop conflicts, `Alt`+`↑`/`↓` scrolls the source panes, each conflict's `[ ]` checkboxes (click) or the Merge Conflict accept commands choose sides — both checked is the combination, "Merge: Accept Combination (Incoming First)" flips the order, "Merge: Ignore (Keep Base)" keeps the ancestor text, and editing the Result by hand marks that conflict manually resolved. The header counts "k/n resolved"; "Merge: Complete Merge" refuses until n/n |
| Command Palette "Merge: Show Base" | Toggle the common-ancestor pane between Current and Incoming in the merge editor |
| Command Palette "Debug: Add Watch Expression" | Add a WATCH row to the Run and Debug panel (also the panel's "+ Add Expression" row): the expression re-evaluates at every stop, a changed value highlights, a rejected one reads `<not available>`; each row's `✕` removes it, "Debug: Remove All Watch Expressions" clears the list. The expression list lives for the croft run; values and the changed-baseline reset when a debug session ends |
| `F2` | Rename Symbol across every file it touches (open tabs edit in-memory and stay dirty). The prompt is validated by `textDocument/prepareRename` first when the server supports it: it pre-fills the server's exact symbol range / placeholder, and an invalid position fails fast with the server's own message instead of a generic error; servers without the capability keep the word-under-cursor prompt |
| `F12` / `Ctrl`+click | Go to Definition (`Shift`+`Ctrl`+click navigates back); `Ctrl` because mouse reports carry no `Cmd` bit and `Option` belongs to multi-cursor. On a range the language server marked as a link (`textDocument/documentLink`: a URL in a comment, an import specifier), the click follows the link instead — web targets to the system opener (or to your own browser through the relay in a remote session), `file://` targets into the editor; any other scheme is refused, since the target is the server's choice and the link text need not reveal it |
| `q`{a-z} … `q` (vim Normal) | Record a keyboard macro into a register: `qa` starts, any editing follows, a bare `q` stops. A red `● REC @a` badge shows in the status bar while recording. The gesture that starts or stops a recording is never itself recorded |
| `@`{a-z} / `@@` (vim Normal) | Replay a register, or repeat the last macro. Counts apply: `3@a` runs it three times. Replay aborts on the first key that errors, leaving earlier iterations applied, and a replay longer than 100,000 keys is refused rather than run — the same limits the palette commands carry, since both share one replay path. Iterations never merge into each other — each starts a fresh undo step — but a macro containing several kinds of edit still undoes in the steps those edits would make on their own |
| Command Palette "Macro: Start/Stop Recording" | The same recorder without vim mode; its macro is the "last macro" that Replay Last and `@@` run. Registers and the palette share one store, so a macro recorded in vim mode replays from the palette and vice versa |
| Command Palette "Macro: Replay Last" / "Macro: Replay N Times…" | Replay once, or prompt for a count. Replay aborts on the first key that errors, leaving earlier iterations applied; a replay longer than 100,000 keys is refused rather than run |
| `Ctrl`+`-` | Go Back: return to the location before the last navigation jump (the keyboard twin of `Shift`+`Ctrl`+click; also on the editor right-click menu and as Command Palette "Go Back") |
| `Ctrl`+`Shift`+`-` | Go Forward: return along the trail Go Back walked, restoring each position (also on the editor right-click menu and as Command Palette "Go Forward"). On terminals without the extended keyboard protocol the chord is indistinguishable from `Ctrl`+`-` and stays Go Back; use the palette there |
| `Cmd+K` `Cmd+Q` | Go to Last Edit Location: jump to the most recent buffer edit across the open editors (VS Code's chord; distinct from the navigator's plain `Cmd+K` `Q`) |
| `Alt`+`F12` | Peek Definition: an excerpt popup at the caret — header `path:line`, numbered lines, the definition marked `▶`; `Enter` converts to the real jump, `Esc` closes, any other key closes and keeps its meaning (also Command Palette "Peek Definition") |
| `Alt`+`Shift`+`F12` | Peek References: the same popup for each reference to the symbol at the caret, titled "Reference 2 of 7"; `Up` / `Down` step through them (wrapping), `Enter` jumps to the one shown, `Esc` closes (also Command Palette "Peek References") |
| `Ctrl`+`F10` | Debug: Run to Cursor. With the debugger paused, resume and stop once at the caret line, without leaving a breakpoint behind |
| `Shift`+`F12` | Go to References (project-wide; one use jumps, several open a picker) |
| `Ctrl`+`Shift`+`F12` | Go to Declaration (where the server implements it; hidden for TypeScript) |
| `Ctrl`+`F12` | Go to Type Definition |
| `Cmd`+`F12` | Go to Implementations (concrete implementors of a trait / interface) |
| Hover or click/tap (300 ms rest) | Hover popup: any diagnostic over the point first, then type / signature info. A click or tap arms the same dwell, so touch screens (Termux) get the popup by tapping an identifier and resting; releasing the press keeps it open |
| Hover a tab (300 ms dwell) | Tooltip with the tab's full path (tells two same-named files apart) |
| Hover a chrome control (300 ms dwell) | Button hint naming the control under the pointer: activity-bar icons (Explorer, Search, …), the EXPLORER header toolbar (New File, New Folder, Refresh Explorer, Collapse Folders, Views and More Actions), the Remote / Source Control header actions, and the SEARCH panel's actions and toggles (Refresh, Clear Search Results, Match Case, Use Regular Expression, …) |
| Right-click | Editor symbol menu: the Go to / Rename / Change All actions above |
| `Cmd`+`E` | Toggle native modal (vim) editing (see below) |
| `Ctrl`+`W` / `Cmd`+`W` | Close the active editor tab (no-op on the last tab) |
## Editor: vim mode (modal editing)
`Cmd`+`E` toggles a native, Rust-implemented modal layer over the editor. It emulates the common daily-driver subset rather than embedding neovim, so it carries no `nvim` dependency and behaves identically local and remote. For full vim with your own plugins, run `nvim` in the shell pane.
The toggle is global and app-wide: it works from any pane and with no file open, and stays on as you switch files. A coloured mode pill (`NORMAL` blue, `INSERT` green, `VISUAL` purple) and the active `:`/`/` line show in the status bar. While off, the editor behaves exactly as the tables above describe, and `Cmd`/`Ctrl` shortcuts keep working in Normal mode, since modal editing only claims unmodified keys.
| Keys | Action |
|------|--------|
| `i` `a` `I` `A` `o` `O` | Enter Insert mode (at cursor, after, first non-blank, end of line, open below, open above) |
| `Esc` | Leave Insert/Visual; clear a pending operator or count |
| `h` `j` `k` `l`, arrows | Move by one cell |
| `w` `b` `e` | Word forward / back / end |
| `0` `^` `$` | Line start / first non-blank / line end |
| `gg` `G` `{n}G` | File start / file end / absolute line |
| `f`/`t`/`F`/`T` `{char}`, `;` `,` | Find char on the line, repeat / repeat-reversed |
| `{n}` prefix | Count for the next motion or operator (`3j`, `2dw`, `5G`) |
| `x` | Delete `{count}` chars under the cursor |
| `d` `y` `c` + motion / text object | Delete / yank / change over a motion (`dw`, `d$`, `dfx`) or text object (`diw`, `ciw`, `daw`) |
| `dd` `yy` `cc` | Linewise delete / yank / change |
| `p` `P` | Paste after / before |
| `u` | Undo |
| `Ctrl`+`r` | Redo |
| `v` `V` | Charwise / linewise Visual; a motion extends, `d` `y` `c` operate |
| `/` `?` then `Enter`, `n` `N` | Search forward / back, jump to next / previous match |
| `:w` `:q` `:wq` `:x` `:q!` `:qa`, `:{n}` | Write, close tab, write-and-close, quit-all, or jump to line n |
When vim mode is on it supersedes the always-on `Cmd`+`d` `d` / `Cmd`+`g` `g` chords; turn it off to get those back.
## Editor: previews
Image tabs (`.png`, `.jpg`, `.jpeg`, `.gif`, `.bmp`, `.webp`) are read-only; every keystroke is swallowed.
**Rendered log (`.log` / `.ansi` / `.out` / `.txt` / extension-less files whose first 8 KiB carry ANSI colour)**
| Keys | Action |
|------|--------|
| Highlighting (palette toggle) | Plain lines in the rendered log are coloured by [tailspin](https://github.com/bensadeh/tailspin): dates, durations, numbers, UUIDs, IPs, URLs, paths, quotes, severity keywords (ERROR/WARN/INFO/DEBUG), booleans and null, and HTTP methods. Lines that already carry their own colours are left as printed. The rendered view still opens only for a file carrying ANSI colour in its first 8 KiB (an uncoloured `.log` stays an ordinary editable file), so this colours the plain lines of a log that is coloured elsewhere: a build log, pytest output, a structured logger's file. "Log: Toggle Highlighting (tailspin)" switches it for every open log and for logs opened later, persisted as `disable_log_highlight` in `config.json` (also a row in Settings) |
**PDF (`.pdf`)**
| Keys | Action |
|------|--------|
| `→` / `↓` / `Page Down` / `Space` | Next page |
| `←` / `↑` / `Page Up` | Previous page |
| `Home` / `End` | First / last page |
| Wheel down / up over the page | Next / previous page |
| Click a link on the page | Open it: an external URL opens in the browser, an internal target flips to its page (needs `pdftohtml` from poppler; only links anchored to text are detected) |
**Spreadsheet (`.csv`, `.tsv`, `.xlsx`, `.xls`, `.xlsb`, `.ods`)**
CSV, TSV, and xlsx grids are editable (xlsx cell edits write through a real xlsx writer, preserving styles and untouched formulas; a formula cell needs a second Cmd+S to consent to its overwrite). xls/ods/xlsb stay read-only. Row/column structure commands are CSV/TSV only.
| Keys | Action |
|------|--------|
| `↑` / `↓` / `←` / `→` | Move the cell cursor (viewport follows) |
| `PageUp` / `PageDown` | Move a full viewport vertically |
| `Home` / `End` | First / last column; with `Cmd`/`Ctrl` also first / last row |
| Type a character | Start editing the cell, REPLACING its value (spreadsheet convention) |
| `Enter` / `F2` | Edit the cell in place (caret at the end) |
| `Enter` (while editing) | Commit and move down; `Tab` commits and moves right; `Esc` cancels |
| `Delete` | Clear the cell |
| `Cmd+S` | CSV/TSV: rewrite the file with its own delimiter and quoting. xlsx: write ONLY the touched cells (styles, widths, untouched formulas survive). An external change refuses once and the next Cmd+S overwrites; an xlsx formula cell is held back separately, and the Cmd+S after ITS refusal replaces the formula |
| Click a cell | Select it; a second click on the selected cell opens the editor |
| Palette: Sheet: Insert Row Below / Delete Row / Insert Column Right / Delete Column | Structure edits anchored on the selected cell |
| Wheel down / up over the grid | Pan three rows |
| `Tab` / `Shift+Tab` | Switch worksheet (multi-sheet workbooks) or table (SQLite databases, which browse read-only through this grid) |
**Hex viewer (any binary file; `File: Reopen as Hex` for the rest)**
Binary files open here automatically instead of erroring; the file is read in windows, so any size opens instantly. `File: Reopen as Text` switches back when the content is text.
| Keys | Action |
|------|--------|
| `←` / `→` | Previous / next byte (`Shift` extends the selection) |
| `↑` / `↓` | One row up / down (`Shift` extends) |
| `PageUp` / `PageDown` | One viewport up / down (`Shift` extends) |
| `Home` / `End` | Start / end of the row; with `Cmd`/`Ctrl`: start / end of the file |
| `Cmd+F` (`Ctrl+F`) | Find bytes: hex pairs (`de ad be ef`) or literal text |
| `F3` | Find next match (wraps; selects the match) |
| `0-9 a-f` (hex grid) / any character (ASCII gutter) | Overwrite the byte under the cursor; two hex digits complete a byte and advance. Pending edits tint amber until saved |
| `Tab` | Switch typing between the hex grid and the ASCII gutter |
| `Cmd+Z` / `Cmd+Shift+Z` | Undo / redo byte edits |
| `Delete` | Revert the byte under the cursor to its on-disk value |
| `Cmd+S` | Write the changed bytes in place (never rewrites the whole file); refuses once if the file changed on disk, twice overwrites |
| `Esc` | Clear the selection and any half-typed nibble |
| Click / drag (hex grid or ASCII gutter) | Park the cursor / select a byte range |
| Wheel | Scroll three rows |
**Archive browser (`.zip`, `.jar`, `.whl`, `.tar`, `.tar.gz`, `.tgz`; misnamed containers detected by content)**
| Keys | Action |
|------|--------|
| `↑` / `↓` / `PageUp` / `PageDown` / `Home` / `End` | Move the member selection |
| `Enter` | Extract the selected member to a scratch copy and open it with its real viewer |
| `E` | Extract the selected member to a folder you pick |
| Click a member | Select it; a second click opens it |
**Audio / video (`.mp3`, `.wav`, `.flac`, `.m4a`, `.mp4`, `.m4v`, `.mov`)**
Open as a read-only info card: format, codec, duration, dimensions, sample rate, channels, bitrate, and tags from the file's own headers, plus a poster frame for video when `ffmpeg` is installed. Playback stays with the system player: `Media: Open in System Player` (palette) hands the file over.
**Word documents (`.docx`, `.odt`)**
Open as a rendered read-only document: headings, emphasis, lists, tables, and embedded pictures. `File: Reopen as Text` moves on to the underlying container (archive browser / hex).
**Jupyter notebooks (`.ipynb`)**
Open as a rendered document (markdown cells, highlighted code with `In [n]` frames, outputs incl. inline images). `File: Reopen as Text` shows the raw JSON and sticks for the tab; `File: Reopen as Preview` returns to the render.
Click a code cell's `▷` to run it in the notebook's kernel. The first run starts the kernel with a Python that has `jupyter_client` and `ipykernel`: the workspace's `.venv` or `venv`, then `$VIRTUAL_ENV`, then `python3`. The notebook's `metadata.kernelspec.name` picks the kernel, so any installed kernelspec works. A running or queued cell shows `In [*]`. Outputs (text, errors, images) stream into the cell as edits to the notebook, so `Cmd+S` saves them the way Jupyter does and `Cmd+Z` takes them back. The palette has `Notebook: Run All Cells`, `Notebook: Interrupt Kernel` (stops the running cell and keeps the kernel) and `Notebook: Restart Kernel`. Closing croft shuts the kernels down.
**SVG (`.svg`)**
Opens as a rendered preview (shapes, text via system fonts, embedded images). `File: Reopen as Text` switches the tab to the editable XML source — the choice sticks for that tab, external edits refresh whichever view the tab shows, and an SVG that fails to parse opens as its source directly.
## Run & Debug
Real breakpoint debugging over the Debug Adapter Protocol. Adapters by language:
* **Python** — the verified adapter (debugpy, CPython 3.14+). croft provisions a private `~/.croft/debug-venv` with debugpy on first use, with no fallback to older interpreters.
* **JavaScript / TypeScript** — under Node via **vscode-js-debug**, the same engine VS Code, Zed and nvim use. croft auto-downloads the pinned `js-debug` server to `~/.croft/js-debug` on first use and talks to it over TCP, spawning the parent + child sessions js-debug requires. `node` must be on `PATH`, and TypeScript binds through source maps.
* **Rust / C / C++** — `lldb-dap` (binary built on launch; breakpoint binding additionally needs a permitted macOS `debugserver`). The adapter is resolved from the Xcode Command Line Tools on macOS or from `PATH` elsewhere, matching the versioned names LLVM ships (`lldb-dap`, `lldb-dap-18`, legacy `lldb-vscode`); on Linux install it with the LLVM package (e.g. `apt install lldb`).
Beyond the zero-config active file, croft reads **debug configurations** from `.vscode/launch.json` (JSONC tolerated, unchanged from VS Code) and `.croft/launch.json` (same schema, for repos that don't want a `.vscode/` directory; it also accepts a bare configuration array).
Mapped fields: `name`, `type` (`python`/`debugpy`, `lldb`/`cppdbg`, `node`/`pwa-node`), `request` (`launch`/`attach`), `program`, `module`, `args`, `env`, `envFile`, `cwd`, `preLaunchTask` (matched against Tasks: Run Task labels; the task runs in its pane and the launch waits for exit 0), `stopOnEntry`, `port` (node and python attach), and `processId` (lldb attach). Every other field passes through to the adapter verbatim, so adapter-specific keys (`justMyCode`, `sourceMaps`, …) work without croft knowing them.
`${workspaceFolder}`, `${file}`, `${fileBasename}`, `${fileBasenameNoExtension}`, `${fileDirname}`, `${fileExtname}`, `${cwd}`, `${pathSeparator}`, and `${env:VAR}` substitute; an unresolvable variable fails the launch with a named error instead of running something half-substituted. `console` is forced to `internalConsole` (croft debugs in-process).
**Compounds** (`"compounds": [{ "name": …, "configurations": [...] }]`) are read from the same file and listed in that picker with their members, unless hidden (below). Members may be bare names or `{ "folder", "name" }` objects, and a compound naming a configuration no launch.json declares reports that member by name. Selecting a compound launches every member as its own debug session ([#567](https://github.com/vitali87/croft/issues/567)). Focus lands on the first member, and "Debug: Switch Session" moves between them. A background member's output still reaches the debug console, tagged with its name. A member that fails to start names itself and leaves the others running, and `"stopAll": true` stops the rest when one ends. A member's own `preLaunchTask` is skipped, with a status saying so; the compound's task runs first. `presentation.hidden` keeps a compound out of that picker entirely, and one asking only to be hidden launches normally; `presentation.group` and `presentation.order` sort it in the picker as VS Code does ([#318](https://github.com/vitali87/croft/issues/318)). A value of the wrong type (`"hidden": "true"`) is refused and named rather than guessed at. A compound's own `preLaunchTask` is honoured: it runs before the member starts and the launch waits for it to exit 0, chaining with the member's own task if it declares one (VS Code runs both).
"Debug: Add Configuration…" writes a new entry for you ([#250](https://github.com/vitali87/croft/issues/250)). It goes to `.croft/launch.json`, which croft rewrites whole. A `.croft/launch.json` with comments or trailing commas would lose them, so it is left alone and the entry is shown for you to paste in, and a `.vscode/launch.json` is never touched. Pick a configuration with "Debug: Select and Start Debugging" or the config row under the Run and Debug panel's button. The pick is what `F5` and restart launch until changed, and an edited launch.json re-reads on the next `F5`.
| Keys | Action |
|------|--------|
| `F5` | Start debugging (the selected `launch.json` configuration, or the active file when none is selected), or resume when paused at a breakpoint |
| `Shift+F5` | Stop the debug session |
| `Shift+Cmd+F5` | Restart the debug session |
| `Ctrl+F5` | Attach to a running Python process |
| `F6` | Pause (interrupt) a running program |
| `Cmd+Opt+Shift+G` | Switch to the next debug session of a compound |
| `F9` | Toggle a breakpoint on the cursor's line (a red dot in the gutter); pushed live when a session is running |
| `Shift+F9` | Add or edit a conditional breakpoint on the cursor's line |
| `Shift+Alt+F9` | Add or edit a logpoint on the cursor's line (amber diamond; prints instead of pausing) |
| `Alt+F9` | Toggle break on raised (not just uncaught) exceptions |
| `F10` | Step over |
| `F11` / `Shift+F11` | Step into / out |
A bare `F5` / `F9` / `F10` / `F11` pressed while the **terminal pane** is focused and no debug session is live is forwarded to the app running in the shell (process-compose's `F10` Quit, htop's `F9` kill) instead of being claimed by the debugger. Modified chords keep their debug meaning everywhere, and `F9` still re-execs into a landed croft update.
Right-clicking the editor **gutter** (the glyph margin / line-number column) opens a breakpoint menu on the clicked line, mirroring VS Code's glyph-margin menu: **Add Breakpoint** / **Remove Breakpoint** and **Add Conditional Breakpoint** / **Edit Condition** (the cursor does not move).
When paused, the Run and Debug panel shows the **call stack** (click a frame to inspect it) and an expandable **variables** tree, plus a **debug console** of program output with a `❯` **REPL prompt** that evaluates expressions in the selected frame. Hovering a variable in the editor shows its current value.
When the session ends the console output stays on screen rather than being wiped back to the Run button. If the program exited without ever hitting a breakpoint you set, the panel says so instead of just "Debug session ended" — the usual sign you ran a library module whose breakpointed code is never called, rather than its entry point.
Gutter marks: the paused line is a yellow `▶`, a breakpoint a red `●`, a conditional breakpoint a red `◆`, and a breakpoint the adapter could not bind a hollow `○`.
Also in the Command Palette: Start / Stop / Pause / Restart Debugging, Toggle Breakpoint, Add Conditional Breakpoint, Step Over, Toggle Break on Raised Exceptions (uncaught always breaks), and Attach to Python Process.
## Extensions sidebar
Jump here with `Cmd+Shift+X` (or the activity-bar icon, or the Command Palette's "View: Show Extensions"). The panel has three sections:
- **BUILT-IN** — the PDF and CSV viewers, Vim mode, the Color Themes, the Python / TypeScript / Rust / Go / YAML / JSON / HTML / CSS / Bash / TOML / C / C++ language servers, and the Python (debugpy), LLDB (Rust/C/C++), and JavaScript (vscode-js-debug) debuggers. Each has a **toggle switch** (blue = on, grey = off); disabling a debugger removes it as an F5 launch option for its file types.
- **INSTALLED** — extensions you added (from the catalog below or by hand-dropping a manifest into `~/.config/croft/extensions/<id>/`), also with enable/disable toggles.
- **AVAILABLE** — the curated **MCP server catalog**: vetted sidecars you can add. Each shows a **+Add** affordance instead of a toggle; adding one writes its manifest into your extensions dir, so it moves up into INSTALLED (enabled). Seeded with **Web Fetch**, **Time**, **MarkItDown** (convert a PDF/DOCX/URL to Markdown), and **csvlens** (a terminal spreadsheet viewer for CSV/TSV).
The lifecycle is **Available → Add → Installed → Enable → (provision on first use)**, each a distinct visible state, and it is reversible. An INSTALLED catalog extension shows a **trash button** (🗑, in the logo orange) just left of its toggle — click it, or select the row and press `Delete`, to uninstall. Either way croft **asks first**: only `Enter` on the confirmation popup removes the manifest (it drops back to AVAILABLE to re-add); `Esc` keeps it. croft only uninstalls what it added from the catalog; a manifest you hand-dropped is your own file, so it shows no trash button and is never deleted (disable it instead). Hover any row for a tooltip explaining the toggle's state, the `+Add` affordance, or the trash button.
**MCP sidecar extensions** contribute commands to the Command Palette (`Cmd+Shift+P`). Adding **Web Fetch** gives *"Web: Fetch URL as Markdown"*: it prompts for a URL, fetches it via the `mcp-server-fetch` sidecar (a separate vetted process croft speaks the Model Context Protocol to over stdio), and opens the result in a Markdown scratch buffer. The first time you invoke a sidecar command, croft shows a one-time consent popup with the exact command it will run; the server is then provisioned pinned (via `uv`/`npm`, into croft's managed dir — never fetched-at-launch) and spawned lazily. The tool definition is fingerprinted on first use and re-verified on every spawn, so a silently-changed tool (a rug-pull) is refused. Turning the extension off and on in the Extensions panel, or uninstalling and re-adding it, approves the new definition. Disabling the extension removes its commands from the palette.
**Viewer extensions** run a terminal program on a file instead of a sidecar. Adding **csvlens** gives CSV and TSV files an *Open in csvlens* entry in the Explorer's right-click menu and a *csvlens: Open in csvlens* palette row for the active file; either opens the file in csvlens in a new terminal pane. Its first run passes the same one-time consent popup a sidecar's does, showing the exact command line; nothing is downloaded or spawned until you allow it. The tool is then used from PATH when present, otherwise its pinned release is downloaded into croft's managed dir.
A filter box at the top narrows all three sections by name, blurb, or id — a local filter, since croft queries no remote marketplace and the catalog is curated and vetted.
| Keys | Action |
|------|--------|
| Type any character | Filter the list (matches name / description / id) |
| `Backspace` | Delete the last filter character |
| `Up` / `Down` | Move the selection |
| `Space` / `Enter` | Flip the selected extension's toggle (on AVAILABLE rows, add it) |
| `Delete` | Uninstall the selected INSTALLED catalog extension (back to AVAILABLE) |
| `Esc` | Clear the filter, or leave the view when it's already empty |
| Click a row | Select it |
| Click the toggle switch | Flip that extension on/off |
| Click the `✕` in the filter box | Clear the filter |
| Hover any row | Tooltip explaining the toggle / `+Add` / how to uninstall |
Disabling takes effect immediately for the viewers and Vim (a disabled PDF/CSV viewer opens that file type as plain text; a disabled Vim makes `Cmd+E` inert); a disabled language server stops spawning on the next launch. The choice persists in `~/.config/croft/config.json`.
## Terminal
| Keys | Action |
|------|--------|
| Any key croft does not bind | Forwarded to the shell PTY (arrows, most `Ctrl+letter`, `Alt+x`, function keys translated to VT escapes) |
| A chord croft binds | **Claimed by croft, whatever pane has focus** - the shell never sees it. Measured by driving every letter through the real key path and watching which ones reach the PTY:<br>`Ctrl` + **F J P Q S V**, and `Ctrl+Shift` + **B C D E F H J L O P R S T V W X Y**<br>`Cmd` + **B C E F K P S T V W**, and `Cmd+Shift` + **B C D E F L O P R S T V W X**<br>Everything else is forwarded, so the chords a shell leans on - `Ctrl+A` `C` `D` `E` `K` `L` `R` `U` `W` `Z` - all reach the app, and so does `Ctrl+B` while the terminal pane is focused (#304), which is what lets Claude Code background a running command; `Cmd+B` still reaches croft from anywhere |
| Bare `F5` / `F9` / `F10` / `F11` | Forwarded while the terminal is focused and no debug session is live, so process-compose's `F10` and htop's `F9` work. Modified, they keep their debug meaning everywhere |
| Mouse drag | Select text, pinned to the scrollback content; drag past an edge to auto-scroll through history. Inside a full-screen app that scrolls by repainting (Claude Code, a pager), the highlight follows its text across the app's own scrolling. Rows covered by the app's chrome (an input box, a floating pill) drop out, while a row with an overlay in its middle keeps both intact ends; the surviving rows stay highlighted, the selection hides entirely only when none remain (copy still yields the whole selection), and it reappears as the text scrolls back. A drag held past an edge forwards wheel ticks, so the app scrolls under the drag |
| `Shift`+click | Extend the existing selection to the clicked cell instead of starting a new one |
| Click / drag inside a full-screen app that tracks the mouse | The app gets the press and release (Claude Code's diff-panel `×`, a lazygit panel, a vim split), so its own controls work. A drag goes to the app only when it asked for motion (vim with `mouse=a`, lazygit); an app that asked for clicks only (Claude Code) keeps croft's drag-to-select. A double-click over any tracking app is the app's too (two forwarded clicks), so word-select is not available there. `Shift`+click / `Shift`+drag always selects with croft; `Cmd`/`Ctrl`+click on a printed URL still opens it |
| Mouse wheel | At a shell prompt, scroll 5000 rows of scrollback (any keystroke snaps to the live bottom). When a full-screen app is tracking the mouse (Claude Code, htop, vim with `mouse=a`), the wheel scrolls that app's own content; `Shift`+wheel scrolls croft's scrollback instead. Full-screen apps that don't track the mouse still get arrow keys |
| `Ctrl`+`B` | Forwarded to the app in the pane, not croft's side bar toggle, while the terminal is focused (Claude Code backgrounds a running command with it and has no other route; the side bar keeps `Cmd`+`B`, the palette and the menu). The opposite call from `Cmd+F` below, and for the opposite reason: this chord is reachable three other ways, that one is croft's only escape hatch out of a full-screen app |
| `Cmd+F` / `Ctrl+F` | Find in terminal: search the active pane's screen + scrollback. Every hit is highlighted (active match in orange, the rest in yellow); `Enter`/`F3` next, `Shift+Enter`/`Shift+F3` previous (both scroll the match into view), `Esc` closes. Reserved by croft like iTerm2/Ghostty, so a full-screen app (Claude Code, vim) never sees the chord; in that mode it searches the visible screen, since the alternate screen has no scrollback |
| `Cmd+Opt+Up` / `Cmd+Opt+Down` (Linux: `Ctrl+Alt`) | Jump to the previous / next command prompt (VS Code's command navigation; the jumped-to prompt parks at the top of the pane). Powered by OSC 133 shell integration, auto-installed for zsh (a `ZDOTDIR` shim that sources your own dotfiles unchanged), bash 4.4+ (the `$ENV` + `--posix` bootstrap kitty and Ghostty use; macOS's system bash 3.2 spawns clean, without hooks), and fish (a `vendor_conf.d` script that defers to fish 4's native marks and only adds hooks on old fish). Opt out with `CROFT_SHELL_INTEGRATION=0` |
| Click a gutter dot on the pane's left border | Each finished command gets a VS Code-style decoration dot at its prompt row: blue for success, red for a non-zero exit. Clicking it opens the command's menu, headed by its exit code and runtime: **Copy Output**, **Select Output**, **Re-run Command**. A command over 10s finishing in a pane you're not focused on announces itself in the status bar on its own |
| `Cmd+K` `Shift+C` / `Shift+S` / `Shift+R` | Keyboard forms of the decoration menu, applied to the last finished command in the active pane: copy its output, select its output, re-run it |
| `Ctrl+Shift+Y` | Copy mode (WezTerm/tmux): a keyboard cursor walks the grid and scrollback with vi keys — `h`/`j`/`k`/`l` or arrows, `w`/`b`/`e` word motions, `0`/`$` line start/end, `g`/`G` oldest/newest line, `Ctrl+U`/`Ctrl+D` half page, `PageUp`/`PageDown` full page. `v` starts a character selection, `V` full lines, `Ctrl+V` a rectangular block; `y` (or `Enter`) copies it to the clipboard and exits, `Esc`/`q` exits without copying. The cursor paints as a green block |
| `Ctrl+Shift+H` | Command history (atuin's model, embedded): search every command croft's shell integration has seen this machine run — across sessions and restarts — each recorded with its directory, exit code, duration, and time. Type to filter (case-insensitive; duplicates collapse to the newest run), `↑`/`↓` select, `Ctrl+R` cycles the scope (all / this directory / failed only), `Enter` types the pick at your prompt without running it, `Esc` closes. Plain `Ctrl+R` still reaches your shell's own reverse search |
| `Cmd+K` `Shift+T` | Reopen the closed terminal: for 10s after closing a pane its process and scrollback stay alive in the background, and this brings it back exactly where it was (the browser reopen-tab convention). After the grace window the pane is disposed for real |
| `Cmd+K` `Shift+W` | Reopen the closed editor tab (VS Code's Reopen Closed Editor, paired with `Cmd+W` the way `Shift+T` pairs with the terminal close): restores the most recently closed tab with its pin state, cursor, and scroll, walking back through the last 20 closes. Files deleted since their close are skipped. Also Command Palette "View: Reopen Closed Editor" |
| `Ctrl+Shift+Space` | Quick select (WezTerm's hint mode): every URL, filesystem path (including `path:line:col`), git SHA, UUID, IP, hex colour/address, and long number on screen gets a short home-row label overlaid, with the bottom-most match labelled cheapest. Type a label to copy the match to the clipboard; type it in UPPERCASE to also paste it into the shell; `Backspace` erases a typed char, `Esc` cancels |
| `Cmd+Enter` (Markdown) / click `▷` (preview) | Runnable docs: every `sh`/`bash`/`zsh`/`fish` fence (and `python`/`node` when the interpreter is on PATH) wears a `▷` on its first line in the Markdown preview. Clicking it - or `Cmd+Enter` with the caret in the fence in the source - shows a confirm popup with the whole block, the pane it will run in (`<file>:<n>`) and its directory (the document's, or the workspace root with `{cwd=root}`); `Y` types it there, reusing that pane when it sits idle at a prompt. Every block confirms, because a README is untrusted input; blocks that look destructive (`rm -rf`, `sudo`, `curl … \| sh`, redirects, `nc`, `chmod`, `--force`, `git reset --hard`) or say `{confirm}` turn the popup red. `{run=false}` removes the glyph; a block carrying a control or bidi/zero-width character is never runnable; the pane is named by the document's path under the workspace. After a block finishes, its output appears under the fence in the preview: the last twelve rows, coloured as the pane printed them, with the exit code named when it is not zero, or a note that croft stopped waiting while the block kept running. `{persist}` WRITES that output back into the document as a fence croft replaces on each run — the only attribute that touches the file on disk, and off unless asked for. `{timeout=N}` stops the capture after N seconds without stopping the block. |
| Triggers (no chord) | iTerm2-style output triggers from `~/.config/croft/triggers.json` (palette: "Preferences: Open Terminal Triggers (JSON)", reloaded on save): each rule is a regex plus an action: `highlight` recolours every visible occurrence live (per-rule `#rrggbb` fg/bg, scrollback included), `notify` posts a status-bar notice (`\0` whole match, `\1`-`\9` capture groups), `bell` posts a bell notice, `capture` collects the whole matching line into the CAPTURES panel tab (iTerm2's Capture Output; click an entry there to jump its pane back to that line), `redact` masks the match (capture group 1 when the regex has one) as `••••` at paint time — the grid keeps the real text, a click on the mask pops it, copies carry the real value unless the rule says `"copy": "masked"`, and the `Cmd+K D` scrollback dump is always masked. A built-in redact set (AWS keys, `sk-`/`ghp_`/`xox` tokens, JWTs, bearer tokens) is on by default (Settings: "Terminal: Redact Secrets"); the status bar counts masks on screen, and "Terminal: Reveal Redacted Secrets for 10s" lifts them briefly. notify/bell/capture fire once per completed output line, capped and never inside full-screen apps |
| Agents: Show Changed Files (palette) | The review queue, one row per agent, grouped by the workspace root its files are in: a worktree lane's group is named by its branch (`agent/fix-login 4`), any other root by its display label (its folder name, disambiguated by the parent when two roots share it, else its full path). A grouped row carries labels and counts (`claude: 6 to review — croft 2; agent/fix-login 4`) rather than file names, since the one-row status bar elides the middle of anything longer; a row whose files all sit under one root keeps the flat `agent: n to review (a.rs, b.rs)` shape, with a sample of at most three names ending in `…` when there are more. Should a file ever be recorded outside every root it is counted under "outside the workspace" rather than dropped |
| Agents: Open Agent Lane (palette) | Show the Explorer's AGENT LANE section, open: each coding agent that changed files, then those files (unreviewed first, marked `●`). Clicking a file opens its diff against the reviewed snapshot; clicking an agent's row folds its files away, or back. The queue and what you marked reviewed are kept per workspace, so they survive a restart. The section is also toggled from the EXPLORER ⋯ menu, and takes no room until an agent has changed something |
| Agents: Review a Changed File… (palette) | Every agent lane's files in a picker (`●` unreviewed, `+n −m` since review); Enter opens the chosen file's diff against its reviewed snapshot, as clicking its row does |
| Agent lanes (no chord) | Which foreground processes are coding agents and what their prompts look like, from `~/.config/croft/agents.json` (palette: "Preferences: Open Agent Lanes (JSON)", reloaded on save): built-in rows for claude, codex, aider, gemini; a row named like a built-in replaces it. A row's `launch` is the command a new worktree lane starts the agent with (the built-ins launch as their own name; a replacing row without one keeps it) |
| Problem matchers (no chord) | User-defined problem matchers from `~/.config/croft/matchers.json` and workspace `.croft/matchers.json` (palette: "Preferences: Open Problem Matchers (JSON)", reloaded on save): regexes with named groups turn any tool's output into PROBLEMS entries at the finished-command boundary, `applies_to` globs scope them to matching commands, and `background` begins/ends patterns make watch tasks (`tsc --watch`) republish on every recompile cycle. tasks.json `problemMatcher` (`$gcc`, `$tsc-watch`, inline patterns) is honoured when a task runs. See [MATCHERS.md](MATCHERS.md) |
| `Cmd+K` `I` | Toggle broadcast input (iTerm2's `Cmd+Opt+I`): every keystroke and paste in the terminal goes to every pane at once. Enabling shows a confirm popup first; every receiving pane wears a red `⇶` name pill while it's on; switching off is instant, and closing down to one pane switches it off automatically |
| `Cmd+K` `Shift+I` | Exclude the active pane from broadcast input (or include it again). The focused pane always receives its own typing; exclusion mutes the mirrored copy while other panes are focused |
| `Shift+PageUp` / `Shift+PageDown` | Page through the pane's scrollback one screen at a time; `Shift+Home` jumps to the oldest line, `Shift+End` snaps back to the live bottom (xterm's convention, leaving the plain keys for the running program). Scrollback depth is 5000 lines by default, configurable via `terminal_scrollback` in `config.json` (applies to new panes) |
| Mouse selection (with Copy on Selection) | The Settings hub's "Terminal: Copy on Selection" toggle (VS Code's `terminal.integrated.copyOnSelection`, off by default) copies a finished drag-selection to the clipboard without the explicit `Cmd+C` |
| ANSI colors (no chord) | Pane colors render through the theme's own 16-color ANSI palette (VS Code's dark terminal defaults), so output looks the same in every host terminal; a theme extension overrides it with a 16-entry `ansi` array in its `[[themes]]` block |
| `imgcat`-style images (no chord) | A program printing an iTerm2 OSC 1337 inline image (`imgcat photo.png`) shows the picture anchored at its output row in the active pane, scrolling with the text and hiding once it scrolls off screen. The newest image per pane shows; text printed after it may sit underneath, since the grid never reserved rows for it |
| `Cmd+K` `D` | Open the pane's entire scrollback in a rendered log tab named after the pane, colours included: the dump is written under `~/.cache/croft/scrollback/` (one file per pane, overwritten on each dump) and opens as a pinned tab through the same ANSI log view a colour log file gets, so find and selection/copy work on it and the theme's palette paints it; dumping the same pane again rebuilds the tab over the new output. A pane whose output carries no colour opens a plain scratch tab instead, where vim mode, block selection and save-to-file also apply |
| `Cmd+K` `N` | Annotate the selection (iTerm2's annotations): pin a note to the selected output span. The span wears a dotted-amber underline that scrolls with the content and survives in scrollback; a plain click on it pops the note. `Cmd+K` `N` over an existing note edits it (a blank commit deletes); `Cmd+K` `Shift+N` deletes the note(s) under the selection. Session-scoped, like the scrollback itself |
| Click the prompt line | Move the shell cursor to the clicked column (Ghostty's click-to-move): croft synthesizes exactly the right number of arrow keys, so it works in zsh, bash, and fish line editors and never touches the typed text. Only at a prompt, only on the cursor's own row |
| Scrolled into long output (no chord) | The command that produced the output pins to the pane's top row with the scroll depth (Warp's sticky header), unpinning when the viewport crosses into another command's span or returns to the live bottom |
| Timestamps (palette toggle) | "Terminal: Toggle Timestamps" paints each row's arrival time (HH:MM:SS) down the right edge; a row that arrived 60s+ after its predecessor is tinted amber with a warning mark — the "where did the deploy stall" view |
| Host accents (config) | `host_accents` rules in `config.json` ({"pattern": "prod-*", "accent": "#f14c4c", "badge": "PROD"}) dress any pane whose shell reports a matching hostname over OSC 7: accent border, warning pill, translucent badge watermark. SSH inside the pane moves the hostname, so production shells are visually unmistakable; rules reload on saving config.json |
| Progress reports (no chord) | A program emitting ConEmu's OSC `9;4;state;percent` (systemd, winget, cargo wrappers; the sequence Ghostty and WezTerm render natively) fills the pane's bottom border into a live gauge: blue for normal progress, red frozen at the failure point on error, yellow when paused, and a sweeping segment while indeterminate. With two or more panes the name pill also shows the percent. Clears on the program's state-0 report or when the command finishes |
| `Cmd+C` / `Ctrl+Shift+c` | Copy the terminal's current selection. On a remote session the text goes to the clipboard of the machine you are typing at, not the remote box's. Inside a program that has asked for mouse tracking a plain drag belongs to that program, so **Shift+drag** is what selects there. A program that has not asked still selects on a plain drag |
| `Cmd+T` / `Ctrl+Shift+t` | Open another terminal beside the current one (each has its own PTY, scrollback, selection) |
| `Cmd+W` / `Ctrl+Shift+w` | Close the active terminal (no-op when one is left; `Ctrl+J` hides the pane) |
| `Cmd+]` / `Cmd+[` | Cycle to the next / previous terminal (or click one to focus it) |
| Click the `⌄` caret (beside `+`) | Drop the terminal profile menu anchored under the caret: pick a shell (from `/etc/shells` + `$SHELL`) to launch a new pane |
| `Cmd+K` `R` | Rename the active terminal pane (a blank name clears it, restoring the auto label) |
| `Cmd+K` `K` | Clear the active terminal's screen and scrollback (VS Code clears with `Cmd+K`) |
| `Cmd+K` `M` | Maximize the active terminal across the panel; press again to restore the even split |
| Click the `⛶` button (beside `-`) | Maximize that pane: it takes the panel's full width and the other terminals move to a rail down the right edge; the button becomes a restore glyph while maximized |
| Click the `‹` button (left of `⛶`) | Collapse that pane to a one-column strip and hand its width to the panes still open. The pane keeps running: nothing is suspended, no output is lost, and `-` still closes |
| Click a collapsed strip | Give that pane its width back. Anywhere down the strip works, not only the `›` chevron at the top |
| Right-click a collapsed strip | Open the pane menu on the folded pane, where **Expand Terminal** is the other way back |
| `Cmd+K` `[` | Collapse the active terminal pane (VS Code folds with `Cmd+K` `[` too). Distinct from `Cmd+[`, which cycles to the previous pane. Collapsing the last expanded pane is refused: `Ctrl+J` is how you put the whole panel away |
| `Cmd+K` `]` | Give every collapsed pane its width back, restoring the even split in one gesture |
| Click a rail row | While maximized: hand that terminal the maximized pane (the highlight marks the active one), so you can shuffle between full-size terminals |
| Wheel over the rail | Scroll the rail when there are more terminals than it has rows; switching panes always scrolls the new one back into view |
| Right-click a terminal pane | Open the pane menu: **Copy** (while the pane has a selection), **Paste**, **Rename Terminal**, **Clear**, **Quick Select**, **Copy Mode**, **Command History**, **Open Scrollback in Editor**, **Reopen Closed Terminal** (while one is in its undo window), **Maximize Terminal** (or **Restore Terminal Split**), **Collapse Terminal** (or **Expand Terminal**), **Broadcast Input** (and, while broadcasting, **Exclude from Broadcast**) |
Collapse and maximize are orthogonal and compose: entering maximize ignores the collapse flags rather than clearing them, and leaving it puts the strips back. Collapse is per-session and deliberately not saved with the pane layout, so a workspace never reopens with half its terminals folded away.
With two or more panes open, each pane's header shows its live foreground process (`zsh`, `vim`, `node`…); a manual rename overrides that label.
The panel's layout survives restarts: the pane arrangement, each pane's directory and name, and which pane was focused are saved per workspace (on splits, closes, renames, reorders, and at quit) and restored as fresh shells the next time croft opens that workspace. A plain single-shell workspace stores nothing.
| `Cmd`/`Ctrl` + click a printed URL | Open it. A loopback dev-server URL on a remote session (`http://localhost:3000`) is forwarded home over the live SSH connection first, then opened in your local browser; any other link opens directly. Real OSC 8 hyperlinks (`ls --hyperlink`, modern CLIs) work too, even when the visible text isn't the URL |
| `Cmd`/`Ctrl` + click a printed `path:line[:col]` | Open that file in the editor at that line and column. Works on compiler errors (`src/x.rs:12:5`), test failures, grep hits, and Python tracebacks (`File "x.py", line 3`); relative paths resolve against the pane's current directory |
## Ports
The PORTS tab in the bottom panel group lists the loopback ports croft has noticed this session, from scraping terminal output (`http://localhost:PORT` banners, `listening on :PORT` lines) and a periodic socket poll of the shell's process subtree. A newly announced port also raises a transient, click-only toast in the bottom-right corner.
The poll only surfaces ports owned by a pane's own processes, so one outside it (a port a container publishes, say) is found by the terminal scrape; it still drops off the list when it genuinely stops listening. On a remote session, forwarding rides the existing SSH master, with no second connection; on a local session a port is already reachable, so the only action is to open it.
| Keys | Action |
|------|--------|
| `↑` / `↓` | Move the selection |
| `⏎` | Open the selected port in your browser (forwarding it home first on a remote session) |
| `f` | Forward the selected remote port without opening |
| `c` | Copy the selected port's address |
| `x` | On a forwarded port, stop forwarding it: the tunnel comes down, the row stays, and you can forward it again. Otherwise dismiss the row, which also stops croft re-detecting that port this session |
| Click a port row | Select it; **double-click** opens it in your browser (forwarding it home first on a remote session), same as `⏎` |
| Click the toast buttons | `Forward & Open` / `Forward` / `Open` / dismiss, depending on whether the session is remote |
## Captures
The CAPTURES tab collects output lines matched by `capture` triggers in `triggers.json` (iTerm2's Capture Output): point a rule at your compiler's error format and every hit funnels into one clickable list, however much output scrolled past.
With a row selected, `n` (or right-click → "Ask Navigator About This Line", or the palette's "Captures: Ask Navigator About This Line") sends the line, the trigger that caught it, and the redacted pane rows around it to the resident Navigator. When the line carries a `path:line` that resolves to an existing file (relative to the pane's cwd, then the workspace), that file opens first so the reply lands as a comment box there; otherwise the ask anchors on the active file, and with none open it says so.
| Keys | Action |
|------|--------|
| `↑` / `↓` | Move the selection |
| `Enter` / click a row | Jump the capturing pane back to that line: the TERMINAL tab activates, the pane scrolls the line into view and selects it |
| `n` | Ask the resident Navigator about the selected line (the pane rows around it ride along, redacted) |
| `x` | Remove the selected entry |
| `c` | Clear the list |
| `Esc` | Focus the editor |
## iTerm2 key mappings
`croft setup-iterm2` installs these `Cmd` chords as CSI-u forwarders (macOS otherwise reserves `Cmd` for menus) and relocates the conflicting iTerm2 / macOS menu shortcuts to unused alternates so their original actions stay reachable. Fully quit iTerm2 (`⌘Q`) and reopen after running it.
| iTerm2 keystroke | What croft does |
|------------------|-----------------|
| `⌘P` | Quick Open |
| `⌘⇧P` | Command Palette |
| `⌘F` | In-editor Find |
| `⌥⌘F` | Replace in File (find bar with the replace row) |
| `⌥⌘↩` | Replace All while the replace row is open |
| `⌘/` | Toggle line comment |
| `⌘.` | Quick Fix (code actions at the cursor; inside a merge conflict, the Accept Current / Incoming / Both picker) |
| `⌥⌘↑` / `⌥⌘↓` | Add a cursor above / below (multi-cursor) |
| `⌘⇧E` / `⌘⇧F` / `⌘⇧S` / `⌘⇧D` / `⌘⇧R` / `⌘⇧X` | Jump to Explorer / Search / Source Control / Run and Debug / Remote / Extensions |
| `⌘⇧L` | Disconnect a remote session |
| `⌘⇧B` | Run the project's build task (auto-detected); iTerm2's View ▸ Show Toolbelt is relocated to `⌃⌘B` |
| `⌘⇧N` | Explorer "New folder" prompt |
| `⌃⇧J` | Maximize the terminal pane |
| `⌥⌘R` | Reveal in Finder: the selected Explorer entry, or the active editor file when the editor is focused (local macOS only) |
| `⌘B` | Toggle the primary side bar |
| `⌘K` | Leader for the `Cmd+K` chords (Color Theme, Close to the Right, compare, Close All, Close Saved, Reveal in Explorer View, Move/Copy into New Window); iTerm2's Edit ▸ Clear Buffer is relocated to `⌥⌘K` |
| `⌘\` | Split the editor |
| `⌘⇧\` | Go to Bracket (jump to the matching bracket) |
| `⌘⌥\` | Select to Bracket |
| `⌘⌥⇧S` / `⌘⌥⇧T` | Convert Indentation to Spaces / Tabs |
| `⌘⌥⇧N` | Trim Final Newlines |
| `⌘⌥⇧J` | Join Lines |
| `⌘⌥⇧U` / `⌘⌥⇧L` / `⌘⌥⇧C` | Transform to Uppercase / Lowercase / Title Case |
| `⌘⌥⇧A` / `⌘⌥⇧D` | Sort Lines Ascending / Descending |
| `⌘⌥⇧W` | Trim Trailing Whitespace |
| `⌘⌥⇧F` | Format Document (reformat the whole buffer via the language server) |
| `⌘K` `F` | Toggle Format on Save |
| `⌘D` | Add Selection to Next Find Match (multi-cursor) |
| `⌘⇧K` | Delete Line |
| `⌥`+click / `⇧⌥`+drag | Add a caret / column (box) selection |
| `⌥⌘←` / `⌥⌘→` | Focus the left / right editor group |
| `⌘F12` | Go to Implementations |
| `⌃⇧F12` | Go to Declaration |
| `⌘S` / `⌘C` / `⌘X` / `⌘Z` / `⌘A` | Save / Copy / Cut / Undo / Select All |
| `⌘⇧Z` | Redo |
| `⌘T` / `⌘W` / `⌘]` / `⌘[` | New terminal / close terminal / cycle terminals |
`⌘V` is deliberately left on iTerm2's native Paste; croft reads the system clipboard and routes it by focus, so paste works identically over SSH. If you skip the setup command, the zero-setup `Ctrl`-based chords above still work, and you can map individual `Cmd` chords by hand in iTerm2 → Settings → Profiles → Keys → Key Mappings (e.g. `⌘S` → Send Hex Code `0x13`).
## Ghostty key mappings
Ghostty resolves its own keybinds (`new_tab`, `goto_tab`, ...) before it hands a key to croft, so by default `⌘T` opens a Ghostty tab and `⌘1`..`⌘9` switch Ghostty tabs instead of reaching croft. `croft setup-ghostty` adds a managed `keybind` block to your Ghostty config (`~/.config/ghostty/config`, or `~/Library/Application Support/com.mitchellh.ghostty/config`) that re-emits every croft chord as the same CSI-u sequence iTerm2 forwards, via Ghostty's `csi:` action. After running it, reload the config (`⌘⇧,`) or restart Ghostty.
The chord set is identical to the [iTerm2 key mappings](#iterm2-key-mappings) above (`⌘T` / `⌘W` / `⌘[` / `⌘]`, `⌘1`..`⌘9` / `⌘0`, the editor / Explorer / Source Control chords, the `⌘F12` family, and so on), so croft behaves the same under both terminals. `⌘V` is left on Ghostty's native paste for the same reason it is under iTerm2. Only the block between croft's marker comments is rewritten on each run; the rest of your Ghostty config is preserved.
## Mouse bindings in `keybindings.json`
Mouse gestures bind in the same array as keys, using a gesture name in `key`
and an optional `when` region:
```jsonc
[
{ "key": "ctrl+click", "command": "mouse_go_to_definition_at_click" },
{ "key": "alt+click", "command": "mouse_add_cursor_at_click" },
{ "key": "middle_click", "command": "search_from_terminal", "when": "terminal" },
{ "key": "alt+wheel_up", "command": "toggle_word_wrap" }
]
```
**Gestures (six bindable):** `click`, `double_click`, `middle_click`,
`right_click`, `wheel_up`, `wheel_down`, each combinable with `ctrl`, `alt`,
`shift`. A seventh name, `triple_click`, is recognised and refused with a
warning rather than ignored — see the refusal table below.
**`when` regions:** `editor` (the default when omitted), `terminal`,
`file_tree`, `tab_strip`. The same gesture can mean different things in
different regions.
User bindings resolve *before* the built-in behaviour, so rebinding one takes
it over; a gesture with no binding falls through untouched.
Three commands read the click position and are meaningless from the keyboard:
`mouse_add_cursor_at_click`, `mouse_go_to_definition_at_click`, and
`mouse_open_link_at_click`. Invoked from the palette they report that they
need a mouse binding rather than guessing at the caret.
### What croft refuses, and why
A refused row is reported in **OUTPUT · Keybindings** and, on a live reload,
summarised in the status bar — it never fails silently.
| Refused | Why |
|---|---|
| `cmd+click` / `super+click` | Terminals do not report Cmd/Super with mouse events (SGR mouse reporting carries no Super bit), so the binding could never fire. Use `ctrl` or `alt`. This is also why croft's own Go to Definition rides Ctrl. |
| `triple_click` | croft's click tracker distinguishes single from double only, so a triple binding would fire on the second click and mean something other than what it says. |
| bare `click` in `editor` or `terminal` | It is how the caret is placed; rebinding it leaves no way to do that. Bare `click` in `file_tree` or `tab_strip` is allowed. |
| bare `double_click` in `editor` or `terminal` | It is the only way to select a word; rebinding it leaves no way to do that. (Over a full-screen app that tracks the mouse the pair is forwarded to the app instead, see the terminal table, so word-select is unavailable there by design.) A *modified* double-click (`ctrl+double_click`) is bindable, and bare `double_click` in `file_tree` or `tab_strip` is allowed. |
`mod` means Ctrl for mouse on every platform, unlike keys where it is Cmd on
macOS — for the same reporting reason.
**In terminal panes**, a TUI that has asked for mouse tracking owns the
pointer, so user bindings do not fire there; hold `shift` to bypass, the same
rule croft's built-in scroll follows.
The pane **border** is the exception: it sits outside the grid the child is
ever told about, so a binding there fires normally however the TUI is
tracking. Same carve-out croft's built-in wheel makes — a notch on the border
scrolls croft rather than vanishing into a program that cannot receive it.
Note that `shift` is *also* part of a gesture's identity, so bypassing selects
a different row rather than rescuing the one you already have: over a tracking
TUI, a `ctrl+click` binding stays silent no matter what, and the row that fires
when you hold shift is `ctrl+shift+click`. Bind that spelling if you want a
gesture that works over a full-screen TUI.