Keybindings¶
Press F1 to see every shortcut, searchable. That panel reads the same
table the editor dispatches from, so it cannot tell you about a key that
does not work.
The full table is also on this site: Every default binding.
The scheme¶
Chords are not handed out first-come-first-served. There are five layers, and which one a binding belongs to follows from what it does.
| Layer | What lives there |
|---|---|
| bare keys | Vim's language — dd, ciw, w. Nothing else may take a bare key. |
Ctrl+x |
What you bring from other editors and the OS: save, copy, paste, undo, find, quick-open. Plus Vim's own Ctrl+D/U/R/O/I. A closed set. |
Ctrl+W then a key |
Structure: regions, their focus, size and life. Vim's window prefix, with Vim's window keys. |
Alt+x |
This editor's own things — panels, pickers, tools. No convention to inherit, so a mnemonic letter. |
F<n> |
Ask the language server. F12 and Shift+F12 are what every editor uses. |
The reasoning, and what it replaced, is ADR 0120.
The Ctrl+W prefix¶
Press Ctrl+W alone and the status bar shows what it is waiting for:
Ctrl+W → C = J K - N O + Q W
j and k move focus between the buffer and the panel below it, w
cycles, c closes whichever region has focus, + and - resize, o
leaves only the editor. Escape cancels.
A prefix that swallows a keystroke and shows nothing is indistinguishable from a dropped key, which is why it tells you.
The prefix is caught application-wide rather than by the editor widget. The whole point is reaching the editor from the panel, and a key only the editor can hear cannot be the way back to it.
Changing one¶
In your config, key.<chord> = <command>:
key.ctrl+s = editor.save
key.alt+g = editor.find-in-project
The command names are listed in Every command. A binding pointing at a name that does not exist is reported in the status bar when you save the config — it does not fail silently.
Only in one Vim mode¶
Put the mode before the chord:
key.normal.ctrl+d = vim.half-page-down
key.insert.ctrl+d = editor.cursor.add-next-occurrence
A mode-qualified binding beats an unqualified one, and your config beats
the defaults — in that order. So you can rebind Ctrl+D everywhere
without disturbing Vim's use of it, or the other way round.
Two-chord sequences¶
> separates the halves:
key.ctrl+w>t = editor.compile
Not ., which is already the mode separator, and not ,, which is a key
you might want to bind.
Turning a default off¶
key.ctrl+d = none
none unbinds. For a sequence it unbinds that one continuation; the
chord stays a prefix for the others.
Writing a chord¶
Lowercase, + between parts, modifiers first: ctrl+shift+s,
alt+left, f12, ctrl+w>j.
Punctuation is spelled out — semicolon, minus, plus, equal,
comma, period, slash, backslash, apostrophe, bracketleft,
bracketright, grave. Named keys are escape, tab, return,
backspace, delete, space, left, right, up, down, home,
end, pageup, pagedown, insert.
Replacing across files¶
Alt+R takes a search term and a replacement, then shows every change it
would make — one row per occurrence, with the line as it would read.
space |
keep or drop the change under the cursor |
Enter |
jump to it, to look before deciding |
Ctrl+Enter |
apply what is left |
Applying opens each affected file as a buffer and edits it there —
nothing is written until you save, so closing without saving undoes
the whole thing. Within one file, u takes back that file's share in one
step. There is no single keystroke that reverses the whole operation
across every file, which is why you are shown it first. See
ADR 0131.
Vim's own keys¶
Bare keys are Vim's, so they are not bound with key. — they are
remapped with vim.:
vim.normal.Y = y$
vim.n = j
See Moving the keys.
Plugin commands¶
A command a plugin registered can be bound like any other:
key.alt+u = uppercase_all
See Writing a plugin.