Key Bindings#

Normal Mode#

Motion#

KeyAction
h / Move left
j / Move down
k / Move up
l / Move right
wMove to start of next word
bMove to start of previous word
eMove to end of next word
WMove to start of next long word
BMove to start of previous long word
EMove to end of next long word
f<char>Move to next occurrence of char
t<char>Move till next occurrence of char
F<char>Move to previous occurrence of char
T<char>Move till previous occurrence of char
HomeGoto line start
EndGoto line end
gg / <n>ggGoto line number <n> else file start
G / <n>GGoto line
gsGoto first non-blank in line
geGoto last line
g| / <n>g|Goto column
]pGoto next paragraph
[pGoto previous paragraph

Goto Prefix (g)#

KeyAction
gdGoto definition
gDGoto declaration
gyGoto type definition
giGoto implementation
grGoto references
gfGoto files/URLs in selections
gnGoto next buffer
gpGoto previous buffer
gaGoto last accessed file
gmGoto last modified file
g.Goto last modification
gtGoto window top
gcGoto window center
gbGoto window bottom

Jumplist#

KeyAction
Ctrl+oJump backward on jumplist
Ctrl+i / TabJump forward on jumplist
Ctrl+sSave current selection to jumplist

Entering Other Modes#

KeyAction
:Enter command mode
iInsert before selection
IInsert at start of line
aAppend after selection
AInsert at end of line
oOpen new line below selection
OOpen new line above selection
vEnter selection extend mode

Editing#

KeyAction
dDelete selection
Alt+dDelete selection without yanking
cChange selection
Alt+cChange selection without yanking
r<char>Replace with new char
uUndo change
URedo change
Alt+uMove backward in history
Alt+UMove forward in history
~Switch (toggle) case
`Switch to lowercase
Alt+`` ``Switch to uppercase
>Indent selection
<Unindent selection
JJoin lines inside selection
Alt+JJoin lines inside selection and select spaces
&Align selections in column
_Trim whitespace from selections
Ctrl+aIncrement item under cursor
Ctrl+xDecrement item under cursor
=Format selection

Yank and Paste#

KeyAction
yYank selection
pPaste after selection
PPaste before selection
RReplace with yanked text
Space+yYank selections to clipboard
Space+YYank main selection to clipboard
Space+pPaste clipboard after selections
Space+PPaste clipboard before selections
Space+RReplace selections by clipboard content
"<reg>Select register
KeyAction
/Search for regex pattern
?Reverse search for regex pattern
nSelect next search match
NSelect previous search match
*Use current selection as search pattern, word bounded
Alt+*Use current selection as search pattern

Selection Manipulation#

KeyAction
sSelect all regex matches inside selections
SSplit selections on regex matches
KKeep selections matching regex
Alt+KRemove selections matching regex
Alt+sSplit selection on newlines
;Collapse selection into single cursor
Alt+;Flip selection cursor and anchor
%Select whole document
xSelect current line, if already selected, extend to next line
XExtend selection to line bounds
Alt+xShrink selection to line bounds
,Keep primary selection
Alt+,Remove primary selection
(Rotate selections backward
)Rotate selections forward
Alt+(Rotate selections contents backward
Alt+)Rotate selection contents forward
Alt+:Ensure all selections face forward
CCopy selection on next line
Alt+CCopy selection on previous line
Alt+-Merge selections
Alt+_Merge consecutive selections
Alt+.Repeat last motion

Match (m prefix)#

KeyAction
mmGoto matching bracket
ms<char>Surround add
mr<from><to>Surround replace
md<char>Surround delete
ma<char>Select around object
mi<char>Select inside object

View / Scroll (z / Z prefix)#

KeyAction
zz / zc / Zz / ZcAlign view center
zt / z. / Zt / Z.Align view top
zb / ZbAlign view bottom
zk / z↑ / Zk / Z↑Scroll view up
zj / z↓ / Zj / Z↓Scroll view down
Ctrl+b / PageUpMove page up
Ctrl+f / PageDownMove page down
Ctrl+uMove page and cursor half up
Ctrl+dMove page and cursor half down

Splits (Ctrl+w or Space+w)#

KeyAction
Ctrl+w v / Ctrl+w Ctrl+vVertical right split
Ctrl+w s / Ctrl+w Ctrl+sHorizontal bottom split
Ctrl+w n v / Ctrl+w n Ctrl+vVertical right split scratch buffer
Ctrl+w n s / Ctrl+w n Ctrl+sHorizontal bottom split scratch buffer
Ctrl+w q / Ctrl+w Ctrl+qClose window
Ctrl+w o / Ctrl+w Ctrl+oClose windows except current
Ctrl+w w / Ctrl+w Ctrl+wGoto next window
Ctrl+w t / Ctrl+w Ctrl+tTranspose splits
Ctrl+w h/j/k/l / Ctrl+w Ctrl+h/j/k/lJump to left/below/above/right split
Ctrl+w H/J/K/LSwap with left/below/above/right split

All Ctrl+w bindings also work with Space+w.

Space Menu#

KeyAction
Space+yYank selections to clipboard
Space+YYank main selection to clipboard
Space+pPaste clipboard after selections
Space+PPaste clipboard before selections
Space+RReplace selections by clipboard content
Space+wWindow (see Splits)
Space+hSelect symbol references
Space+aPerform code action
Space+kShow docs for item under cursor
Space+rRename symbol
Space+sOpen symbol picker
Space+SOpen workspace symbol picker
Space+fOpen file picker
Space+FOpen file picker at current working directory
Space+eOpen file explorer at workspace root
Space+.Open file explorer at current buffer’s directory
Space+bOpen buffer picker
Space+jOpen jumplist picker
Space+/Global search in workspace folder
Space+?Open command palette
Space+'Reopen the last picker
Space+cComment/uncomment selections
Space+Alt+cLine comment/uncomment selections
Space+CBlock comment/uncomment selections

Prev/Next ([ / ])#

KeyAction
[pGoto previous paragraph
]pGoto next paragraph
[␣Add newline above
]␣Add newline below

Comments and Macros#

KeyAction
Ctrl+cComment/uncomment selections
QRecord macro
qReplay macro

Shell#

KeyAction
|Pipe selections through shell command
Alt+|Pipe selections into shell command ignoring output
!Insert shell command output before selections
Alt+!Append shell command output after selections
$Filter selections with shell predicate

Insert Mode#

KeyAction
EscapeEnter normal mode
←↓↑→Move cursor
HomeGoto line start
EndGoto newline at line end
Ctrl+r <reg>Insert register
Ctrl+sCommit changes to new checkpoint
Ctrl+h / BackspaceDelete previous char
Ctrl+d / DeleteDelete next char
Ctrl+w / Alt+BackspaceDelete previous word
Alt+d / Alt+DeleteDelete next word
Ctrl+uDelete till start of line
Ctrl+kDelete till end of line
Ctrl+j / ReturnInsert newline char
TabInsert tab if all cursors have all whitespace to their left, else complete current word
Ctrl+xComplete current word
PageUp / Ctrl+bMove page up
PageDown / Ctrl+fMove page down

Completion Popup#

KeyAction
Return / TabAccept completion
EscapeCancel completion
/ Ctrl+pPrevious completion
/ Ctrl+nNext completion
PageUpPrevious completion page
PageDownNext completion page
HomeFirst completion
EndLast completion

Select Mode#

Select mode extends the current selection. Motion keys move the selection’s head rather than collapsing it.

KeyAction
h/j/k/lExtend selection
w/b/e/W/B/EExtend by word
f/t/F/TExtend to character
Home / EndExtend to line start/end
xSelect current line, if already selected, extend to next line
ggExtend to line number <n> else file start
geExtend to last line
g|Extend to column
n / NAdd next/previous search match to selection
EscapeExit selection mode

All other Normal mode commands (editing, clipboard, search) work the same in Select mode.


Picker Navigation#

When any picker is open (file picker, buffer picker, global search, etc.):

KeyAction
/ Ctrl+pMove up
/ Ctrl+nMove down
ReturnOpen selected item
Ctrl+sOpen in horizontal split
Ctrl+vOpen in vertical split
EscapeClose picker