croft-software 0.2.82

VSCode-style TUI written in Rust
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
# 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)).
* **Linux** — `Ctrl` is the command modifier, as in VS Code: `Cmd` chords work as the same chord with `Ctrl`, the `Cmd+K` chords included (`Ctrl`+`K` leads everywhere except the terminal pane and the vim-mode editor). A handful whose `Ctrl` form is taken need `Super`; [LINUX.md](LINUX.md#the-command-modifier) lists them.
* **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. A folder of its path that is gone (removed by a `git checkout`, say) is created again |
| Command Palette: `File: Save As…` | Write the open file's buffer to a prompted path (workspace-relative, prefilled with its own) and make the tab that file. Missing folders are created; an existing file is never overwritten. Bind `save_as` in keybindings.json for a key |
| Command Palette: `File: Revert File` | Drop the open file's unsaved edits for the text on disk, as one undo step: `Cmd`+`Z` brings the edits back. A tab with nothing unsaved is left alone. Bind `revert_file` in keybindings.json for a key |

| A file you have unsaved edits in changes on disk | A prompt asks what to do. Typing `reload` + Enter replaces the buffer with the disk version, after recording your unsaved version in Local History (TIMELINE). Esc, or Enter on any other answer (keys typed before you noticed the prompt), keeps your edits; the box says so under the field |
| Typing `(` `[` `{` or a quote | Auto-closing pairs: the pair inserts with the caret between (openers never before a word; quotes never after one, a Python string prefix such as `f"` or `rb'` excepted, nor inside a string or comment); 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 (from any pane but a focused terminal, where it goes to the app running there: vim, nano, the shell's XON). If any tab in any editor group has unsaved changes, a prompt asks first: `S` / `Enter` saves them all and quits, `D` quits without saving, `Esc` / `N` cancels. Save all stays open, naming each file, when anything cannot be saved: an untitled buffer (it has no file to go to; copy its text out or choose `D`), a file changed on disk, text its encoding cannot hold, a merge with conflicts left, a file open in two editor groups with different unsaved text (the same text in both is saved once). Unsaved buffers are also backed up a few seconds after the last edit (hot exit, under `~/.cache/croft/hot-exit/`), so a kill or crash loses only the edits since the last backup that was written, usually those few seconds. A write that fails is said in the status line and tried again every 5 s; until one lands, the last backup written is what a crash leaves. The next launch of the workspace brings them back as unsaved tabs, nothing written to their files, and names any file changed on disk since. A clean quit, `S` once the saves land, and `D` remove the backup, so for a quit the prompt is still the last chance to keep unsaved edits |
| `F1` | Open the shortcuts modal |
| `F6` | Cycle focus across panes (tree → editor → terminal → tree) |
| `Shift+F8` | Screencast Mode (Command Palette: `Developer: Toggle Screencast Mode`), for recording a demo: each key you press shows in a box at the bottom of the screen for a moment after the last one, the command a palette pick or `keybindings.json` chord ran is named beside its key, and a click lights the cell it landed on. Typing gathers into one run, a held key counts (`↓ ×12`), and a `Cmd+K` chord reads as one (`Ctrl+K Z`). A paste shows as `Paste`, never its text. Nothing typed into a password field or the shell is shown, only the keys around it. The box moves to the top while it would cover the caret. Press again to stop |
| `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 |
| `Ctrl+Shift+PageUp` / `Ctrl+Shift+PageDown` | Move the active editor tab one place left / right along its group's tab bar (the palette's "View: Move Editor Left" / "View: Move Editor Right"). Pinned tabs stay ahead of the others, so a tab moves only within its own block |
| Drag an editor tab along the tab bar | Reorder it: the tab moves the moment the pointer crosses another tab, and stays active |
| Command Palette: `View: Move Editor into Next Group` / `View: Move Editor into Previous Group` | Move the active tab into the group after / before this one; with none that way, a new group opens to the right / left to hold it, and a group left empty closes. Bind `move_editor_to_next_group` / `move_editor_to_previous_group` for a key. The tab's right-click menu also has Move Left / Right / Above / Below |
| `Cmd+Opt+←` / `Cmd+Opt+→` | Move focus to the left / right editor group while split (or click a column, or the Command Palette's "View: Focus Left Editor Group" / "View: Focus Right Editor Group") |
| `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+p` / `Cmd+p`, then `>`, `@` or `:` | As in VS Code, the first character picks the mode and the rest carries over: `>` runs commands (the Command Palette), `@` goes to a symbol in the open file (Go to Symbol in Editor), and `:12` goes to line 12 of it. A file name with a line, `a.py:12`, is still a file search |
| `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+s` needs a terminal that reports the `Shift` (the kitty keyboard protocol: kitty, Ghostty, WezTerm, Alacritty); others send it as `Ctrl+s`, which saves. Under tmux only 3.2 to 3.4 with `extended-keys always` reports it ([LINUX.md](LINUX.md#the-command-modifier)) |
| `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, go.mod, CMakeLists.txt). "Tasks: Run Task" and "Tasks: Rerun Last Task" live in the Command Palette. Every task, like every Testing run, first saves the unsaved editors, as VS Code's `task.saveBeforeRun` does ([#1639](https://github.com/vitali87/croft/issues/1639)); `"disable_save_before_debug": true` turns that off too, and the status line then names the unsaved files the task runs without |
| `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 (asks first about unsaved changes, as `Ctrl+q` does) |
| `Ctrl+Shift+m` / `Cmd+Shift+m` | Show the PROBLEMS tab of the bottom panel (VS Code's "View: Focus Problems") |
| `Ctrl+Shift+u` / `Cmd+Shift+u` | Show the OUTPUT tab; the palette's "Output: Select Channel…" picks its channel from the keyboard. Where the desktop's input method claims `Ctrl+Shift+u` for Unicode entry (IBus), use the palette's "View: Show Output" |
| `Cmd+Shift+t` | Focus the terminal pane, un-hiding the panel and bringing its TERMINAL tab forward over PROBLEMS / OUTPUT / PORTS / CAPTURES (also the palette's "Terminal: Focus Terminal") |
| `Ctrl+Alt+s` / `Cmd+Opt+s` | Save All: the active tab saves as `Cmd+S` does, then every other tab with unsaved edits, in every split. A tab that must not be written blind (changed on disk, an encoding that would lose characters, an unresolved merge, a hex or sheet edit) is left for its own `Cmd+S`, and the status line says how many |
| `Ctrl+Shift+h` / `Cmd+Shift+h` | Replace in Files: jump to the Search sidebar with its Replace row expanded and focused (VS Code's chord). In the terminal pane `Ctrl+Shift+h` stays command history; `Cmd+Shift+h` works there too |
| 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 Loch, Croft Black drawn as layered surfaces without pane boxes / 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, and High Contrast / High Contrast Light for low vision) or Customize Layout |
| Click the sponsor heart (just above the gear) | Open croft's GitHub Sponsors page in the browser; "Help: Sponsor croft" in the Command Palette does the same |
| 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. On Linux `Ctrl`+`K` leads everywhere except the terminal pane, where it goes to the shell, and the editor while vim mode is on, where it kills to the end of the line; a `Cmd` on the second key (`Cmd+K` `Cmd+S`) is `Ctrl` there too.

| 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; tabs with unsaved changes stay open (also the palette's "View: Close Editors to the Right in Group") |
| `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, in every split, keeping tabs with unsaved changes open (close one with `Cmd+W` to be asked about it; also the palette's "View: Close All Editors") |
| `Cmd+K` `U` | Close all saved (non-dirty) editor tabs of the focused group, keeping unsaved ones (also the palette's "View: Close Saved Editors in Group") |
| `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; save a tab with unsaved changes first) |
| `Cmd+K` `Z` | Toggle Zen Mode: hide the activity bar, both side bars, the panel, and the status bar, and centre the editor; press again to restore exactly what was shown before |
| `Esc` `Esc` | Leave Zen Mode (two Escapes in the editor within half a second; an Esc that closes a popup or clears a selection does not count) |
| `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, `s` (or the ■ Stop control, or Testing: Cancel Test Run) stops a run or discovery in flight, `r` re-discovers, `o` opens OUTPUT on the Test Runner channel (as does clicking the "see OUTPUT › Test Runner" pointer a failed discovery or run shows), 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 (with the `env`, `cwd`, `args`, `justMyCode` and other settings of a launch.json debugpy configuration whose `purpose` lists `"debug-test"`, as in VS Code), 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 |
| (palette) | "Testing: Run All Tests", "Testing: Run Tests in Current File", "Testing: Rerun Failed Tests" and "Testing: Rerun Last Run" (VS Code's everyday test commands, unbound by default; bind them by id `testing_run_all`, `testing_run_file`, `testing_rerun_failed`, `testing_rerun_last`, or import VS Code's `testing.runAll`, `testing.runCurrentFile`, `testing.reRunFailTests`, `testing.reRunLastRun`). Run Tests in Current File runs the file's own tests: a pytest file, a cargo module (`src/a/b.rs` is `a::b`), a go package, a CodeQL test; a cargo crate root, a `src/bin` file, an integration test and jest/vitest files cannot be picked out by name, and the status says to use Run All Tests. Rerun Failed Tests runs exactly the tests the tree shows failed; Rerun Last Run repeats the last run as it was asked. While a run is going each says "Tests are already running" |
| `Cmd+K` `P` | Pin / unpin the active editor tab (moved off `Cmd+K` `Shift+Enter`, which now debugs tests; also the palette's "View: Pin Editor" / "View: Unpin Editor") |
| `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; also the palette's "View: Keep Editor") |
| `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, a multi-line one with its further lines hung under the caret's line; `Tab` accepts it (recorded as the navigator's writing), `Ctrl+Right` accepts its next word and `Ctrl+Down` its next line (the rest stays as ghost text), `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; the key is sent only over https or to this machine). Off by default, because it sends code to the model |
| Command Palette "Rust: …" | rust-analyzer's own commands, listed while it serves the active file: **Expand Macro Recursively at Caret** opens what the macro call (or `#[derive]`) under the caret expands to in a Rust tab; **Locate Parent Module** jumps to the `mod` declaration of the caret's module; **Open Cargo.toml** opens the crate's manifest; **Rebuild Proc Macros and Build Scripts** and **Reload Workspace** ask the server to redo them after proc-macro output or a `Cargo.toml` edit went stale. VS Code keybindings to `rust-analyzer.expandMacro`, `.parentModule`, `.openCargoToml`, `.rebuildProcMacros` and `.reloadWorkspace` import onto them |
| `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). A server that has not answered in 2 s, or a second `Cmd+S`, saves the file unformatted |
| `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+1` … `Cmd+K` `Cmd+7` | Fold Level 1–7: collapse every fold that many levels deep or deeper and leave the outer ones open, so Fold Level 2 on a module shows its classes and their methods' headers with the bodies collapsed |
| Command Palette: `Fold Recursively` / `Unfold Recursively` | Collapse or expand the fold at the cursor together with every fold inside it. Palette only (VS Code's `Cmd+K Cmd+[` / `]` collapse and restore terminal panes here); bind `fold_recursively` / `unfold_recursively` for a key |
| `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: `View: Change Line Numbers (On, Relative, Interval, Off)` | Cycle the gutter's numbers: on (default) → relative (the caret's line shows its number, the rest their distance from it, for Vim counts like `5j`) → interval (every tenth line) → off (no number column); the caret's number is brighter; persisted as `line_numbers`, 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**, or run **View: Customize Layout…** from the Command Palette. The popup mirrors VS Code's title-bar layout controls and stays open while you flip several toggles. Every row is also a palette command (VS Code's names), so a bar hidden with a click comes back from the keyboard; the palette query "layout" lists them all:

| Group | Options |
|-------|---------|
| Visibility | Activity Bar (**View: Toggle Activity Bar Visibility**), 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 (**View: Toggle Status Bar Visibility**), 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); **View: Toggle Primary Side Bar Position** swaps it |
| Panel Alignment | Left / Center / Right / Justify (Justify spans the full width under the side bar); **View: Set Panel Alignment…** picks one from the keyboard |
| Quick Input Position | Top / Center (where Command Palette / Go to File appears); **View: Set Quick Input Position…** picks one from the keyboard |
| Zen Mode | `Cmd`/`Ctrl`+`K` `Z`; `Esc` `Esc` leaves it. Zen centres the editor unless `layout.zen_center_layout` is `false` |
| Centered Layout | Keeps the editor `layout.centered_layout_width` columns wide (120 by default) in the middle of its column; also **View: Toggle Centered Layout** |

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. Off macOS the chord reads with `Ctrl` for `Cmd` and `Alt` for `Opt`, and with `Super` for the few chords [LINUX.md](LINUX.md#the-command-modifier) lists without a `Ctrl` form; the Keyboard Shortcuts view does the same.

| 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 |
| Markdown: Run Code Block at Cursor | `Cmd`+`Enter` | Run the runnable fence under the caret in a Markdown source, through the same confirm popup as the chord: the route on a terminal that sends `Ctrl`+`Enter` as a bare `Enter` |
| Select All | `Cmd`+`A` | Select the whole active editor buffer. The palette is the Linux route: there `Ctrl`+`A` is line start |
| View: Focus Left Editor Group / View: Focus Right Editor Group | `Cmd`+`Opt`+`←` / `Cmd`+`Opt`+`→` | Move focus to the left / right editor group while split: the Linux route, where `Ctrl`+`Alt`+arrows switch desktop workspaces |
| Terminal: Focus Next Terminal / Terminal: Focus Previous Terminal | `Cmd`+`]` / `Cmd`+`[` | Focus the terminal pane and cycle to the next / previous terminal: the Linux route, where `Ctrl`+`[` is `Esc` |
| Go to Implementations | `Cmd`+`F12` | Go to the concrete implementors of the trait / interface at the caret: the Linux route, where `Ctrl`+`F12` is Go to Type Definition |
| C/C++: Switch Header/Source | `Alt`+`O` | Open the counterpart of a C, C++ or Objective-C source or header |
| Explorer: Jump to Directory (zoxide) | `Cmd`+`Z` in the Explorer | Open the zoxide jump popup from any pane: the Linux route, where `Ctrl`+`Z` is kept out of the Explorer |
| 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 |
| File: New Untitled Text File | `Cmd`+`N` (from the editor or the side bar) | A scratch tab, `Untitled-1`, `Untitled-2`, …, with no file behind it; saving it asks where to write it |
| File: New File… / File: New Folder… | palette only (`Cmd`+`F` / `Cmd`+`Shift`+`N` while the Explorer is focused) | The Explorer's create prompt from any pane: beside the active file, or in the Explorer selection while the Explorer has focus (or no file is open) |
| Select All | `Cmd`+`A` | Select the whole active editor buffer. The palette is the Linux route: there `Ctrl`+`A` is line start |
| View: Show Ports / View: Show Captures | palette only | Show the PORTS / CAPTURES tab of the bottom panel and focus it, so its keys (`↑`/`↓`, `⏎`, …) work at once |
| Output: Select Channel… | palette only | Pick an OUTPUT channel (the toolbar dropdown's list) and show it |
| View: Close Other Editors in Group | palette only | The tab menu's **Close Others** on the active tab: every other tab of the focused group closes, pinned tabs excepted; other splits are untouched. Bind it in `keybindings.json` for a key (the menu's `⌥⌘T` is iTerm2's New Tab, which croft leaves alone) |
| View: Close Editors to the Right in Group / View: Close Saved Editors in Group / View: Close All Editors | `Cmd`+`K` `→` / `Cmd`+`K` `U` / `Cmd`+`K` `W` | The tab menu's **Close to the Right**, **Close Saved** and **Close All**, on the active tab, exactly as the menu does them (Close All empties every split) |
| View: Pin Editor / View: Unpin Editor | `Cmd`+`K` `P` | The tab menu's **Pin** / **Unpin** on the active tab. As in VS Code, the palette lists only the one that applies; bound in `keybindings.json`, each leaves a tab already in its state alone |
| View: Keep Editor | `Cmd`+`K` `Shift`+`P` | The tab menu's **Keep Open**: the italic preview tab stays when the next file opens (the palette also finds it as "keep open") |

**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`/`-s`/`-S`, `-w`, `-F`/`-E`, `-g`), matching case as the tool did (case-sensitive unless told otherwise; smart case for `-S` and ag), scopes it to the paths and rg `-t`/`-T` types the command searched (resolved from the pane's directory), and runs it. A command whose scope can't be reproduced exactly (`-v`, `-L`, an unknown type, a path outside the workspace) is refused with the reason rather than seeded wider. 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` | Your settings: only the keys you set, every other setting at its default (a new file starts empty); 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 JSONC (`//` and `/* */` comments and trailing commas are fine, as in VS Code) 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.
* `when` is optional: `"when": "editor"` makes the chord fire only while the editor has focus, and `"when": "file_tree"` only while the Explorer has focus. In that pane it wins over a row for the same chord with no `when`, which still fires everywhere else. `terminal` and `tab_strip` are mouse-only regions and are refused on a chord with a warning.

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 string, or an array of them so one snippet answers to several words), a `body` (a string or an array of lines), and an optional `scope` (comma-separated language ids; omit for every language). A snippet croft cannot read is skipped and named in OUTPUT · Snippets; the rest still load. 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 (or, in a file no server takes, alongside the words already in the open documents of its language: Ctrl+Space in a Makefile, a `.env` or a note offers `BUILD_DIRECTORY` once it is typed anywhere; setting `word_based_suggestions`) and is accepted with `Enter`/`Tab`. Like VS Code's, the file is JSONC: comments and trailing commas are fine. A file that still does not parse loads no snippets and says why in OUTPUT · Snippets.

**Project snippets.** A repository's own snippets load too, so a team's shared boilerplate expands for everyone: every `.vscode/*.code-snippets` file (VS Code's project snippets) and `.croft/snippets.json`, in each workspace folder, in the same format. Your `snippets.json` comes first, so on a prefix both define your snippet wins `Tab`, and the project's still shows in completion. Adding, editing or removing one of these files applies within a couple of seconds, from croft or from a `git pull`.

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, and a body line's leading `\t` is one indent level, inserted as the file's own indent unit (spaces in a space-indented file, a tab in a tab-indented one). Language-server completions that arrive as snippets (rust-analyzer's `println!` and the like) expand the same way.

Variables expand as in VS Code: `$TM_FILENAME`, `$TM_FILENAME_BASE`, `$TM_DIRECTORY`, `$TM_FILEPATH`, `$RELATIVE_FILEPATH`, `$WORKSPACE_NAME`, `$WORKSPACE_FOLDER`, `$TM_SELECTED_TEXT`, `$TM_CURRENT_LINE`, `$TM_LINE_INDEX`, `$TM_LINE_NUMBER`, `$CLIPBOARD`, `$LINE_COMMENT`, `$BLOCK_COMMENT_START`, `$BLOCK_COMMENT_END`, the local date and time parts (`$CURRENT_YEAR`, `$CURRENT_YEAR_SHORT`, `$CURRENT_MONTH`, `$CURRENT_MONTH_NAME`, `$CURRENT_MONTH_NAME_SHORT`, `$CURRENT_DATE`, `$CURRENT_DAY_NAME`, `$CURRENT_DAY_NAME_SHORT`, `$CURRENT_HOUR`, `$CURRENT_MINUTE`, `$CURRENT_SECOND`, `$CURRENT_SECONDS_UNIX`, `$CURRENT_TIMEZONE_OFFSET`), `$RANDOM`, `$RANDOM_HEX` and `$UUID`. `$TM_SELECTED_TEXT` is empty, since a snippet expands from its prefix with nothing selected; `${TM_SELECTED_TEXT:default}` inserts the default, as any empty variable does, and a variable croft does not know becomes a placeholder holding its name. Not supported yet: transforms such as `${TM_FILENAME/(.*)\\..+$/$1/}`, which are not expanded, a picker for choices (`${1|a,b|}` inserts `a`), and live mirroring of a repeated stop (in `${1:x} = ${1:x}`, typing at the first leaves the second as `x`).

## 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) |
| `Ctrl`+`Z` / `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; if zoxide is missing, the popup offers to install it and wire the shell hook, showing the exact command and rc file, and does nothing until you press `y`; if zoxide is installed but your rc has no `zoxide init` line and its list is empty, it offers the hook alone, the same way. From any pane, the Command Palette's "Explorer: Jump to Directory (zoxide)" opens the same popup |
| 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`, and from any pane via the palette's "File: New File…" / "File: New Folder…") |
| 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 the Save All icon on the OPEN EDITORS header | Save All (as `Ctrl+Alt+S` / `Cmd+Opt+S`), VS Code's Open Editors action; shown while the section is expanded |
| 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. The caption above the results counts every occurrence, as VS Code does ("4 results in 2 files"): two matches on one line are two results, the same count the Replace All confirmation gives |
| Click `Aa` / `ab` / `.*` (inset at the right of the search field) | Toggle case-sensitive / whole-word / regex; active toggles show an accent chip |
| `Alt`+`C` / `Alt`+`W` / `Alt`+`R` | The same three toggles from the keyboard, from any Search input (VS Code's keys; also the palette's "Search: Toggle Match Case" / "Toggle Match Whole Word" / "Toggle Use Regular Expression"). On macOS the terminal must send Option as Alt (iTerm2: Option key "Esc+"); one that types `ç` / `∑` / `®` instead keeps typing them |
| 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 (`▸`/`▾`), or `Ctrl`/`Cmd`+`Shift`+`H` from anywhere | Expand / collapse the Replace row (expanding focuses it; the chord, "Search: Replace in Files" in the palette, only ever opens 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, `$&` for the whole match and `$$` for a dollar; any other `$NAME` or `$N` that names no group in the pattern stays as typed, and `$10` with fewer than ten groups is `$1` then `0`); files open with unsaved changes are skipped and named, and the search re-runs afterward |
| Click the `...` icon, or `Alt`+`D` in a Search input | Expand / collapse the "files to include" and "files to exclude" glob inputs (also the palette's "Search: Toggle Search Details"; VS Code's `Ctrl+Shift+J` is croft's maximize-terminal) |
| Type globs into include / exclude | Restrict the search to / from matching files (comma-separated, VS Code style; a bare `*.rs` matches at any depth, and brace alternates like `*.{ts,tsx}` are one glob). A glob that doesn't compile shows as `invalid glob: …` in red above its box, and an include box with no valid glob matches nothing. 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, and grows a row per line up to six, then scrolls). Pasted text keeps its line breaks |
| `Shift`+`Enter` / `Alt`+`Enter` | Start a new line in the commit message (a blank line, then the body and trailers); `Up` / `Down` move between its lines |
| `Home` / `End` | Start / end of the caret's line in the commit message; with `Ctrl`, the start / end of the whole message |
| `Enter` | Commit all tracked changes with the message. The commit runs in the background, so croft keeps responding while the repository's hooks run; the message stays in the box until the commit lands, and a hook's rejection shows below it. If a tab under the repository has unsaved edits, every commit and stash variant first asks, as VS Code does: `S`/`Enter` Save All & Commit (or Stash), which saves the tabs and goes ahead only once all of them are saved; `C` Commit (or Stash) Anyway, with the files as they are on disk; `Esc` cancels |
| Click ✓ Commit | Same as `Enter` |
| `Tab`, or `Down` on the message's last line | Move to the change list. There `Up` / `Down` select a row, `Enter` opens its diff as a click does, `Space` or `S` stages it, `U` unstages it, and `Backspace`, `Delete` or `D` discards it (confirms first). `Tab`, or `Up` on the first row, returns to the message box; opening Source Control always starts in the message box |
| Command Palette "Git: Commit" / "Git: Push" / "Git: Pull" / "Git: Sync" / "Git: Checkout to…" / "Git: Stash" | The Commit button's and the menus' actions, each bindable in `keybindings.json` |
| Click a change row | Open that file's diff against HEAD in a read-only editor tab, reused on the next click. With unsaved edits the diff shows them; hunk actions then ask for a save first |
| `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 |
| `F7` / `Shift`+`F7` in an editor tab | Jump to the next / previous change bar in the gutter, wrapping (VS Code's Go to Next / Previous Change; also in the Command Palette). In a file with conflicts, F7 hops conflicts instead |
| Command Palette "Git: Stage Hunk" / "Git: Unstage Hunk" / "Git: Revert Hunk" in an editor tab | Act on the change bar under the caret, against HEAD, without opening a diff. Save first: the hunk is taken from the file on disk |
| 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 buttons. 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. A remote branch (`upstream/feat`) checks out as a local branch tracking the remote you picked, even when another remote has a branch of the same name |
| 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>` (everything this branch changed since it left the default branch, uncommitted edits included, as a pull request diff shows it; the default branch's own later commits stay out) |
| 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, Undo Last Commit, Commit & Push, Commit & Sync; Undo Last Commit is `git reset --soft HEAD~1`, putting the commit's changes back in Staged and its message back in the box, refused mid-merge or mid-rebase, and asked twice when the commit is already pushed; also Command Palette "Git: Undo Last Commit") · **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, Push Tags, Delete Remote Tag; Create asks for an optional message, and one makes an annotated tag; Push Tags and Delete Remote Tag use the remote Publish Branch would, and Delete Remote Tag picks from that remote's tags and asks before deleting; also Command Palette "Git: Create Tag", "Git: Push Tags", "Git: Delete Remote Tag") · 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 |
| Right-click a row in COMMITS | The commit's actions: Cherry-Pick, Revert (`--no-edit`, git's own message), Checkout (Detached), Create Branch Here, Create Tag Here, Reset Current Branch to Here (Soft / Mixed / Hard; Hard warns first and runs when chosen again for the same commit), Copy Commit Hash, Copy Commit Message. A cherry-pick or revert that conflicts stops for Git: Continue / Skip / Abort |
| 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 |
| Stash, Stash (Include Untracked), Stash Staged | Ask for the stash's name first, seeded with the commit box's first line; `Enter` names the stash, a blank name keeps git's `WIP on <branch>` name, `Esc` stashes nothing. The Apply / Pop / Drop pickers show each stash's name, age and files (`stash@{1}: On main: retry tweak · 5 minutes ago · src/net.rs`) |
| Command Palette "Git: View Stash…" (also **Stash › View Stash**) | Pick a stash and open its changes, untracked files included, as a patch in a read-only tab, without applying or dropping it |

## Editor: text

| Keys | Action |
|------|--------|
| Arrows, Home, End | Navigate (clears any selection). `Down` on the last line goes to its end and `Up` on the first line to its start, so `Shift`+`Down` / `Shift`+`Up` select through the ends of the file. With word wrap on, Home and End (not `Ctrl+A` / `Ctrl+E`) go to the start / end of the wrapped row the caret is on first, and to the start / end of the line on a second press |
| `Shift`+arrows / `Home` / `End` / `PageUp` / `PageDown` | Extend the selection by the same motion |
| `Ctrl`+`←` / `→` (`Opt`+`←` / `→` on Mac) | Move to the start of the previous word / the end of the next one; `Ctrl`+`Shift`+`←` / `→` selects by word |
| `Ctrl`+`Backspace` / `Ctrl`+`Delete` (`Opt`+`Backspace` / `Opt`+`Delete` on Mac) | Delete the word left / right of the caret, as far as `Ctrl`+`←` / `→` would move (a selection is deleted instead). It stays on the caret's line: at the line's start or end it joins the neighbouring line, as `Backspace` / `Delete` do |
| `Ctrl`+`Home` / `Ctrl`+`End` (`Cmd` on Mac) | Go to the start / end of the file; with `Shift`, select to there |
| `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; also Copy Line Up / Down in the Command Palette (ids `copy_line_up` / `copy_line_down`, to rebind in `keybindings.json`) |
| `Cmd`/`Ctrl`+`Opt`+`↑` / `↓` | Add a cursor above / below the current one (multi-cursor) |
| `Cmd`/`Ctrl`+`Shift`+`Opt`+arrows / `PageUp` / `PageDown` | Column (box) selection from the keyboard, like `Shift`+`Opt`+drag: grow the box one row, one column or one screen, with one selection per row, so typing edits the same columns of every line. The box starts at the caret and keeps growing while the carets are the ones it made |
| View: Toggle Column Selection Mode (palette) | While on, plain `Shift`+arrows and `Shift`+`PageUp` / `PageDown` grow a column selection; the status bar shows "Column Selection" beside Ln/Col |
| `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) |
| `Alt`+`O` | C/C++: Switch Header/Source: open the header of the C, C++ or Objective-C source in the editor, or the source of the header, found beside it, across an `include/` ↔ `src/` split, else the same-named file elsewhere in the workspace that shares the most folders with it (also Command Palette, id `switch_header_source`) |
| `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. Brackets inside strings and comments are text and are skipped, as they are for bracket-pair colours, the match highlight and Select to Bracket |
| `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. With several cursors each one swaps around itself, in one undo step |
| `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 |
| Command Palette "Transform to Snake Case" / "Camel Case" / "Pascal Case" / "Kebab Case" | Rewrite each identifier in the selection (or the word under the cursor, at every caret) as `user_name` / `userName` / `UserName` / `user-name`, splitting at `_`, `-` and case changes (`parseHTTPResponse` is `parse_http_response`) |
| `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, …); the edit lands as one undo step and leaves the tab dirty. In a Prettier project (a Prettier config above the file and `node_modules/.bin/prettier` installed) JS/TS, JSON, CSS, HTML, Markdown and YAML files go through the project's Prettier instead, as with VS Code's Prettier extension; Format on Save does the same |
| `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 | The breadcrumbs bar above the editor shows the file path and the enclosing symbol trail at the caret. Clicking a folder crumb lists that folder (Enter opens a file or lists a subfolder), the file crumb lists its folder, and a symbol crumb lists the symbols beside it; Enter jumps |
| `Cmd+Shift+.` / `Ctrl+Shift+.` | View: Focus and Select Breadcrumbs: the last crumb's list; Left / Right move to the neighbouring crumb's list |
| 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 (on Linux `Ctrl`+`A` is line start: the Command Palette's "Select All") |
| `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 |
| `Alt`+`L` in the Find bar | Find in Selection: limit the matches, the count, Enter / Shift+Enter and Replace / Replace All to the selection (the caret's line with none), shown by a lit `≡` on the query row; again to search the whole file (also the Command Palette's "Find: Toggle Find in Selection") |
| `Ctrl`+`A` / `Ctrl`+`E` | Move to start / end of line |
| `Ctrl`+`K` / `Ctrl`+`U` | Kill to end / start of line (yanks to clipboard). On Linux (outside vim mode) and Termux `Ctrl`+`K` is the `Cmd+K` leader instead; the Command Palette's "Kill to End of Line" kills there, or bind `ctrl+k` to `kill_to_end_of_line` in `keybindings.json` |
| `Cmd`+`Enter` (or `Cmd`+`o`) / `Cmd`+`Shift`+`Enter` | Insert Line Below / Above: open a new line under / over the current one, inheriting indent, without splitting it (in a Markdown fence `Cmd`+`Enter` runs the block instead) |
| `Enter` in a Markdown list or quote, or a doc comment | Continue it on the new line: a `-`, `*` or `+` bullet repeats, a numbered item counts up (`1.` then `2.`), a task box comes back unticked (`- [ ] `), and `>` quotes carry over; `Enter` on an empty item ends the list instead. In Rust, JS/TS, C/C++, Java and C#, `Enter` after `/**` opens the block with ` * ` and closes it with ` */` when nothing below does, `Enter` on a ` * ` line adds the next one, and Rust `///` / `//!` lines continue. Plain `//` comments and lines inside a fenced code block are left alone |
| `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. For line N, `Cmd`+`g` N `g`, `Cmd`+`g` N `Enter` (VS Code's Go to Line, `Ctrl`+`G` `25` `Enter`), or `Cmd`+`N` `Cmd`+`g` `g`. `Esc` cancels the chord; after N any other key cancels it too, swallowed with the digits rather than typed |
| `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 (whole words when it selected the word itself; a selection you made matches as text, inside other words too) |
| `Cmd`+`Shift`+`L` / `Ctrl`+`Shift`+`L` | Select All Occurrences of Find Match: a cursor on every occurrence of the selection (or the word under the cursor) at once; also in the Command Palette |
| `Shift`+`Alt`+`I` | Add Cursors to Line Ends: one cursor at the end of every line the selection touches; also in the Command Palette |
| `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 |
| `Ctrl`+`Space` | Trigger Suggest: open the completion list at the caret (also Command Palette "Trigger Suggest", id `trigger_suggest`). It also opens by itself: when you begin a word in code (not in a string, a comment or Markdown; `"disable_quick_suggestions": true` turns that off), and when you type a character the file's language server lists as a completion trigger, such as `.` for members or TypeScript's `"` and `/` in an import path. Typing filters the list, `Enter` / `Tab` accepts, `Esc` closes it for the rest of the word |
| `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 the file's own `@name = value` lines, a `.http.env.json` (or JetBrains' `http-client.env.json` and `http-client.private.env.json`) beside the file, or `{{$env.NAME}}`; a variable with no value refuses to send). An env file may be flat or split into named environments, `{"$shared": {…}, "dev": {…}}`: `$shared` always applies, and **HTTP: Switch Environment** picks the environment on top of it. 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**, **HTTP: Copy Request as curl** and **HTTP: Switch Environment** |
| `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 buttons (short labels on a narrow row) |
| `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 |
| Commit while MERGE CONFLICTS lists a file | Refused with "Resolve N merge conflict(s) (…) and stage them before committing": Commit, Commit All, Commit & Push and Commit & Sync stage on your behalf, which would record the `<<<<<<<` markers. Stage each resolved file (or use Complete Merge) first |
| 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, the Accept Current / Accept Incoming / Accept Both buttons above each conflict in the side panes, its `[ ]` 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. A reply that arrives after you have typed into a file it edits is refused, with a status saying so, rather than applied at positions that no longer hold the symbol (also Command Palette "Rename Symbol", id `rename_symbol`) |
| `F12` / `Ctrl`+click | Go to Definition (`Shift`+`Ctrl`+click navigates back). A jump to another file keeps the tab it starts from open, promoting it if it was the preview, so the call and the definition are both tabs (Go Back and Go Forward do the same); `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 (also Command Palette "Go to Definition", id `go_to_definition`) |
| `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 terminal paste into the editor (bracketed paste, a middle click, a paste the terminal handles) is recorded too, and replays as the same paste; one into another pane is skipped and noted in OUTPUT's Macros channel |
| `@`{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, or to the file and line you left when Quick Open, a Search result, the Explorer or a tab switched files (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) (also Command Palette "Go to References", id `go_to_references`) |
| `Ctrl`+`Shift`+`F12` | Go to Declaration (where the server implements it; hidden for TypeScript) (also Command Palette "Go to Declaration", id `go_to_declaration`) |
| `Ctrl`+`F12` | Go to Type Definition (also Command Palette "Go to Type Definition", id `go_to_type_definition`) |
| `Cmd`+`F12` | Go to Implementations (concrete implementors of a trait / interface) (also Command Palette "Go to Implementations", id `go_to_implementations`). On Linux `Ctrl`+`F12` is Go to Type Definition, so it is `Super`+`F12` or the palette command |
| 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). On Linux `Ctrl`+`E` stays end of line, so it is `Super`+`E` or the Command Palette's "Toggle Vim Mode" |
| `Ctrl`+`W` / `Cmd`+`W` | Close the active editor tab (no-op on the last tab). A tab with unsaved changes asks first: `S` / `Enter` saves and closes, `D` closes without saving, `Esc` / `N` cancels; the tab's `✕`, its context menu's Close and View: Close Editor ask the same way. Close Others and Close to the Right keep unsaved tabs open |

## 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. It is also remembered: croft saves it as `vim_mode` in `config.json`, and the next launch starts in the mode you left. Settings has the same switch as **Editor: Vim Mode**, and `croft import-vscode` turns it on when VSCodeVim is installed. 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`). As in Vim, `cw` on a word changes it up to its end and keeps the space after it |
| `dd` `yy` `cc` | Linewise delete / yank / change |
| `p` `P` | Paste after / before |
| `u` | Undo. A change and everything typed before its `Esc` (`cw`…, `ciw`…, `cc`…, `o`…, `i`…) undo as one step |
| `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. `:q`, `:wq` whose write did not land, and `:qa` ask about unsaved changes as `Cmd+W` and `Ctrl+q` do; `:q!` and `:qa!` discard them without asking |

Not supported: `.` (repeat the last change) and `>>` / `<<` (indent). Pressing them says so in the status bar.

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 |
|------|--------|
| `Up` / `Down`, `PageUp` / `PageDown`, `Home` / `End` (also with `Ctrl`) | Scroll the log a line, a screen, or to the top / the tail. The tab is read-only, so typed keys change nothing. When the file changes on disk the view reloads where it was, and a view at the tail follows it, so lines a program appends come into view as they are written (a truncated log clamps to what is left) |
| 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 opens by itself only for a file carrying ANSI colour in its first 8 KiB. An uncoloured `.log` stays an ordinary editable file, shown as "Log" in the status bar and coloured the same way in the editor (up to 4 MB). "File: Reopen as Preview" opens any plain text file with no grammar (a `.txt` or `.out` capture, a `.log`) in the rendered view; it sticks for the tab across reloads, and "File: Reopen as Text" goes back. "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 (in a SQLite table, of the whole table: its first or last 500-row page is loaded) |
| 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: write the file with its own delimiter. Rows you did not change go back byte for byte, so a one-cell edit changes one line. A changed or added CSV row is quoted the way the file is: every field, every field but numbers, or only cells that need it. TSV is never quoted (a `"` in a TSV is a plain character). 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. Text that looks like hex (`1234`, `cafe`) is found as text in double quotes (`"1234"`) or when searching from the text column (`Tab`); the status line says which was searched for |
| `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 notebook naming a kernel this machine does not have (a `conda-env-…` or a venv kernel from someone else's machine) opens a picker of the installed kernels instead, on the one for the notebook's language; the choice runs the cells and is written to `metadata.kernelspec`, so Save keeps it. 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), `Notebook: Restart Kernel` and `Notebook: Select Kernel` (pick another installed 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). croft provisions a private `~/.croft/debug-venv` (CPython 3.14+) with debugpy on first use to host the adapter only. The program runs under the project's own interpreter, the one Run uses: the nearest `.venv` / `venv` / `.env` inside the workspace, else `python3`, so its installed packages import; a launch.json `python` overrides it. It needs no debugpy and no 3.14. When the program stops on an exception, the Run and Debug panel and the status line name the exception type and message.
* **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.
* **Browser JavaScript / TypeScript** — launch.json `chrome` / `pwa-chrome` and `msedge` / `pwa-msedge` configs run on the same js-debug, which starts or attaches to Chrome or Edge itself. `url`, `file`, `webRoot` (default: the workspace folder), `runtimeExecutable`, `runtimeArgs`, `userDataDir` and `pathMapping` pass through as in VS Code; an attach with no `port` uses 9222. With no display (over SSH, or Linux with no `DISPLAY` or `WAYLAND_DISPLAY`), the browser launches with `--headless=new` and the status says so.
* **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`, `chrome`/`pwa-chrome`, `msedge`/`pwa-msedge`), `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, or, for an `"isBackground": true` watch task such as `tsc --watch` with `$tsc-watch`, for its first build to end with no errors, leaving the watcher running), `stopOnEntry`, `port` (node and python attach), and `processId` (lldb attach). A `cppdbg` configuration's `environment` list and `stopAtEntry` map to `env` and `stopOnEntry` (an explicit `env` wins per key); its gdb-only keys (`MIMode`, `miDebuggerPath`, `setupCommands`, …) have no effect under lldb-dap, and the debug console names them. Every other field passes through to the adapter verbatim, so adapter-specific keys (`justMyCode`, `sourceMaps`, …) work without croft knowing them. A Python session steps through your own code only (`justMyCode` on, as in VS Code and debugpy) unless the configuration sets `"justMyCode": false`.

`${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`.

Every launch (`F5`, restart, a picked configuration or compound, Debug Test, and the Run button) first saves the unsaved editors, as VS Code's `debug.saveBeforeStart` does ([#1400](https://github.com/vitali87/croft/issues/1400)): the debuggee reads its files from disk, while breakpoints follow the buffer. They are written as typed, without format on save, whose edits could move lines after the breakpoints were sent. A file changed on disk since it was opened is never overwritten to start a launch; it stays unsaved and the status line names it. Set `"disable_save_before_debug": true` (or VS Code's `"debug.saveBeforeStart": "none"`) to launch without saving; the status line then names the unsaved files the launch runs without.

| 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 (the palette's "Debug: Step Into" / "Debug: Step Out", ids `step_into` / `step_out` in `keybindings.json`) |

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.

`F9` is Toggle Breakpoint whatever croft's own updater is doing. The updater has its own chord, `Ctrl+Shift+F9` (`Cmd+Shift+F9` too), also reachable by clicking the status bar's update pill or "Help: Update croft (Relaunch or Rebuild)" in the Command Palette: it relaunches into a landed update ("⟳ Update ready"), or, when croft is older than the source checkout it was built from ("⟳ croft abc1234 < repo def5678"), rebuilds and reinstalls it in the background. Otherwise it stages the version the update popup offers, or, with none on offer, checks for a newer release now and says what it found, including when there is no internet connection.

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. Program output keeps its colours (pytest `--color=yes`, chalk, coloured logging), long lines wrap to the panel's width, and the whole console is mirrored to the OUTPUT panel's **Debug Console** channel, where it reads at full width, without the colour codes, and can be searched and copied. 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, Continue, Step Over, Step Into, Step Out, Step Into Target (pick which call on the paused line to enter, such as `scale()` in `transform(load(p), scale(2))`; an adapter that cannot list the calls steps into the first), 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 at once, and one turned back on or added starts at once for the files already open. 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 S**, and `Ctrl+Shift` + **B C D E F H J L M O P R S T U V W X Y**<br>`Cmd` + **B C E F K P S T V W**, and `Cmd+Shift` + **B C D E F H L M O P R S T U 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 do `Ctrl+B`, `Ctrl+Q` and `Ctrl+V` while the terminal pane is focused (#304, #1290), which is what lets Claude Code background a running command and vim enter visual block; `Cmd+B` still reaches croft from anywhere |
| Command Palette: `Terminal: Clear` / `Rename` / `Kill the Active Terminal Instance` / `Split Terminal` / `Create New Terminal (With Profile)` / `Quick Select` / `Enter Copy Mode` / `Show Command History` / `Open Scrollback in Editor` | The terminal's actions as commands (ids `terminal_clear`, `terminal_rename`, `terminal_kill`, `terminal_split`, `terminal_new_with_profile`, `terminal_quick_select`, `terminal_copy_mode`, `terminal_command_history`, `terminal_open_scrollback`), acting on the active pane. Bind them in `keybindings.json`: a chord bound to a `Terminal:` command is taken before the shell sees it while the terminal has focus (VS Code's commands-to-skip-shell), and the pane's right-click menu shows it. `croft import-vscode` maps VS Code's `workbench.action.terminal.clear` / `rename` / `kill` / `split` / `newWithProfile` chords to them. On Linux this is the way to clear or rename from the terminal itself, where `Ctrl+K` goes to the shell |
| Command Palette: `Terminal: Run Selected Text in Active Terminal` | Run the editor's selection in the active terminal pane, then Enter: a block goes as one paste (bracketed when the program asked for it), so a `python3`, `psql` or `node` REPL gets it whole. With no selection it runs the caret's line and moves the caret to the next non-blank line, so repeated runs step through a script. Focus stays in the editor. Bind `run_selected_text` in keybindings.json for a key |
| 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 |
| `Ctrl`+`Q` / `Ctrl`+`V` | Forwarded to the app in the pane while the terminal is focused (#1290): vim's visual block, nano's search backwards and page down, the shell's XON. Quit keeps `Ctrl`+`Q` from every other pane, and paste keeps `Ctrl`+`Shift`+`V`, `Cmd`+`V` and the pane menu, as in VS Code's terminal on Linux |
| `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 (the `$ENV` + `--posix` bootstrap kitty and Ghostty use on 4.4+; macOS's system bash 3.2 reads the same hooks through `--rcfile`), 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` | In the terminal pane (elsewhere it is Replace in Files): 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. A closed file's undo history is kept for the session: reopened this way or from anywhere else, its `Cmd+Z` / `Cmd+Shift+Z` history comes back, as long as the file still holds the text it had when it closed (the last 30 closed files keep theirs). 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; `Ctrl+Enter` on Linux) / 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. A shell-session transcript, a `console` / `shell-session` fence or a shell fence that opens with a `$ ` prompt, runs only its commands: the `$ ` (or a `console` fence's root `# `) prompt is stripped, a command continued with `\`, a trailing `|` / `&&`, an open quote or a heredoc keeps its continuation lines, and every other line is sample output that never runs; a transcript with no prompt line wears no glyph. Clicking it - or `Cmd+Enter` with the caret in the fence in the source, or the Command Palette's "Markdown: Run Code Block at Cursor" - 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; a shell block of several lines goes as one command, so it runs in the pane's shell as a script would, on past a failing line. 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 of the whole block, coloured as the pane printed them, with its exit code (its last command's) 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 access key ids plus the secret access key and session token wherever a variable, config key, JSON field or `aws configure` prompt names them; `sk-`, `ghp_`/`github_pat_`, GitLab `glpat-`, Slack `xox`, Stripe `sk_live_`/`rk_live_` and Google `AIza` keys; JWTs; bearer tokens; the password in a `scheme://user:password@host` URL) 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). The Command Palette's "Terminal: Focus Next Terminal" / "Terminal: Focus Previous Terminal" do the same from any pane and focus the terminal |
| 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**, **Split Terminal**, **Kill Terminal** (with more than one pane), **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 (the palette's "View: Show Ports" from the keyboard) 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 (the palette's "View: Show Captures" from the keyboard) 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 |
| `⇧⌥⌘` + arrows | Column (box) selection |
| `⌘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 (the first of `config.ghostty` or `config` found in `$XDG_CONFIG_HOME/ghostty`, default `~/.config/ghostty`, then `~/Library/Application Support/com.mitchellh.ghostty`; a new `config` in the latter when there is none) 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. It is macOS-only, like the `Cmd` chords it forwards: elsewhere it refuses rather than write a file Ghostty does not read.

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.

In `tab_strip`, the tab commands act on the tab under the click rather than
the active tab, as VS Code's tab menu does: `close_editor`,
`close_other_editors`, `close_editors_to_the_right` and `keep_editor`. With no
binding, a `middle_click` on a tab closes that tab, asking first if it has
unsaved edits.

### 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.