v0.51.0 a9d674e

keychord_hint.go RawHistoryFolder

1package modes
2
3import (
4	"os"
5	"strings"
6)
7
8// slideBackChordHint returns the keyboard chord the user must press
9// to peel the most recently queued ("sliding in") message back into
10// the editor. The chord itself is decoded the same way everywhere
11// (see KeyUp with k.Alt in handleKey) — what changes is which
12// physical combo actually delivers a modified-arrow escape sequence
13// to the process:
14//
15//   - Ghostty, iTerm2 (with the "Esc+" / Meta=Option setting),
16//     Terminal.app (with "Use Option as Meta key"), Alacritty,
17//     Kitty: bare Option+Up sends \x1b[1;3A (mod=3 / Alt) which
18//     our parser reads as KeyUp + Alt. Good.
19//
20//   - VS Code's integrated terminal (xterm.js) on macOS does NOT
21//     forward Option+Up as an Alt-modified arrow by default — it
22//     either swallows the Option as a compose modifier or emits a
23//     character. But Option+Shift+Up reliably sends \x1b[1;4A
24//     (mod=4 / Shift+Alt) because the Shift bit forces the
25//     CSI-with-modifier path. Our parser already treats mod=4 as
26//     alt=true, so the binding fires; we just need to tell the
27//     user the right chord.
28//
29//   - Vev reserves Alt+Up for pane navigation. Alt+Shift+Up is
30//     forwarded to the child process as \x1b[1;4A instead.
31//
32// Detection is by $TERM_PROGRAM; VS Code sets this to "vscode" on
33// every platform it ships an integrated terminal on. The decoder
34// accepts both chords on any terminal, so getting the env-var sniff
35// wrong only ever shows a slightly-off hint string — never breaks
36// the binding itself.
37func slideBackChordHint() string {
38	if strings.EqualFold(os.Getenv("TERM_PROGRAM"), "vev") {
39		return "Alt+Shift+↑"
40	}
41	if strings.EqualFold(os.Getenv("TERM_PROGRAM"), "vscode") {
42		return "Option+Shift+↑"
43	}
44	return "Option+↑"
45}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 476

↑↓ moveenter openesc close