Keymap

Normal mode

Movement

NOTE: Unlike vim, f, F, t and T are not confined to the current line.

KeyDescriptionCommand
h, LeftMove leftmove_char_left
j, DownMove downmove_char_right
k, UpMove upmove_line_up
l, RightMove rightmove_line_down
wMove next word startmove_next_word_start
bMove previous word startmove_prev_word_start
eMove next word endmove_next_word_end
WMove next WORD startmove_next_long_word_start
BMove previous WORD startmove_prev_long_word_start
EMove next WORD endmove_next_long_word_end
tFind 'till next charfind_till_char
fFind next charfind_next_char
TFind 'till previous chartill_prev_char
FFind previous charfind_prev_char
HomeMove to the start of the linegoto_line_start
EndMove to the end of the linegoto_line_end
PageUpMove page uppage_up
PageDownMove page downpage_down
Ctrl-uMove half page uphalf_page_up
Ctrl-dMove half page downhalf_page_down
Ctrl-iJump forward on the jumplistjump_forward
Ctrl-oJump backward on the jumplistjump_backward
vEnter select (extend) modeselect_mode
gEnter goto modeN/A
mEnter match modeN/A
:Enter command modecommand_mode
zEnter view modeN/A
ZEnter sticky view modeN/A
Ctrl-wEnter window modeN/A
SpaceEnter space modeN/A
KShow documentation for the item under the cursorhover

Changes

KeyDescriptionCommand
rReplace with a characterreplace
RReplace with yanked textreplace_with_yanked
~Switch case of the selected textswitch_case
`Set the selected text to lower caseswitch_to_lowercase
Alt-`Set the selected text to upper caseswitch_to_uppercase
iInsert before selectioninsert_mode
aInsert after selection (append)append_mode
IInsert at the start of the lineprepend_to_line
AInsert at the end of the lineappend_to_line
oOpen new line below selectionopen_below
OOpen new line above selectionopen_above
uUndo changeundo
URedo changeredo
yYank selectionyank
pPaste after selectionpaste_after
PPaste before selectionpaste_before
" <reg>Select a register to yank to or paste fromselect_register
>Indent selectionindent
<Unindent selectionunindent
=Format selectionformat_selections
dDelete selectiondelete_selection
cChange selection (delete and enter insert mode)change_selection

Shell

KeyDescriptionCommand
|Pipe each selection through shell command, replacing with outputshell_pipe
A-|Pipe each selection into shell command, ignoring outputshell_pipe_to
!Run shell command, inserting output before each selectionshell_insert_output
A-!Run shell command, appending output after each selectionshell_append_output

Selection manipulation

KeyDescriptionCommand
sSelect all regex matches inside selectionsselect_regex
SSplit selection into subselections on regex matchessplit_selection
Alt-sSplit selection on newlinessplit_selection_on_newline
;Collapse selection onto a single cursorcollapse_selection
Alt-;Flip selection cursor and anchorflip_selections
CCopy selection onto the next linecopy_selection_on_next_line
Alt-CCopy selection onto the previous linecopy_selection_on_prev_line
(Rotate main selection forwardrotate_selections_backward
)Rotate main selection backwardrotate_selections_forward
Alt-(Rotate selection contents forwardrotate_selection_contents_backward
Alt-)Rotate selection contents backwardrotate_selection_contents_forward
%Select entire fileselect_all
xSelect current line, if already selected, extend to next lineextend_line
XExtend selection to line bounds (line-wise selection)extend_to_line_bounds
Expand selection to parent syntax node TODO: pick a keyexpand_selection
JJoin lines inside selectionjoin_selections
KKeep selections matching the regex TODO: overlapped by hover helpkeep_selections
$Pipe each selection into shell command, keep selections where command returned 0shell_keep_pipe
SpaceKeep only the primary selection TODO: overlapped by space modekeep_primary_selection
Ctrl-cComment/uncomment the selectionstoggle_comments

TODO: The search implementation isn't ideal yet -- we don't support searching in reverse, or searching via smartcase.

KeyDescriptionCommand
/Search for regex patternsearch
nSelect next search matchsearch_next
NAdd next search match to selectionextend_search_next
*Use current selection as the search patternsearch_selection

Minor modes

These sub-modes are accessible from normal mode and typically switch back to normal mode after a command.

View mode

View mode is intended for scrolling and manipulating the view without changing the selection. The "sticky" variant of this mode is persistent; use the Escape key to return to normal mode after usage (useful when you're simply looking over text and not actively editing it).

KeyDescriptionCommand
z , cVertically center the linealign_view_center
tAlign the line to the top of the screenalign_view_top
bAlign the line to the bottom of the screenalign_view_bottom
mAlign the line to the middle of the screen (horizontally)align_view_middle
jScroll the view downwardsscroll_down
kScroll the view upwardsscroll_up
fMove page downpage_down
bMove page uppage_up
dMove half page downhalf_page_down
uMove half page uphalf_page_up

Goto mode

Jumps to various locations.

NOTE: Some of these features are only available with the LSP present.

KeyDescriptionCommand
gGo to the start of the filegoto_file_start
eGo to the end of the filegoto_last_line
hGo to the start of the linegoto_line_start
lGo to the end of the linegoto_line_end
sGo to first non-whitespace character of the linegoto_first_nonwhitespace
tGo to the top of the screengoto_window_top
mGo to the middle of the screengoto_window_middle
bGo to the bottom of the screengoto_window_bottom
dGo to definitiongoto_definition
yGo to type definitiongoto_type_definition
rGo to referencesgoto_reference
iGo to implementationgoto_implementation
aGo to the last accessed/alternate filegoto_last_accessed_file

Match mode

Enter this mode using m from normal mode. See the relavant section in Usage for an explanation about surround and textobject usage.

KeyDescriptionCommand
mGoto matching bracketmatch_brackets
s <char>Surround current selection with <char>surround_add
r <from><to>Replace surround character <from> with <to>surround_replace
d <char>Delete surround character <char>surround_delete
a <object>Select around textobjectselect_textobject_around
i <object>Select inside textobjectselect_textobject_inner

TODO: Mappings for selecting syntax nodes (a superset of [).

Window mode

This layer is similar to vim keybindings as kakoune does not support window.

KeyDescriptionCommand
w, Ctrl-wSwitch to next windowrotate_view
v, Ctrl-vVertical right splitvsplit
h, Ctrl-hHorizontal bottom splithsplit
q, Ctrl-qClose current windowwclose

Space mode

This layer is a kludge of mappings, mostly pickers.

KeyDescriptionCommand
fOpen file pickerfile_picker
bOpen buffer pickerbuffer_picker
sOpen symbol picker (current document)symbol_picker
aApply code actioncode_action
'Open last fuzzy pickerlast_picker
wEnter window modeN/A
spaceKeep primary selection TODO: it's here because space mode replaced itkeep_primary_selection
pPaste system clipboard after selectionspaste_clipboard_after
PPaste system clipboard before selectionspaste_clipboard_before
yJoin and yank selections to clipboardyank_joined_to_clipboard
YYank main selection to clipboardyank_main_selection_to_clipboard
RReplace selections by clipboard contentsreplace_selections_with_clipboard

Unimpaired

Mappings in the style of vim-unimpaired.

KeyDescriptionCommand
[dGo to previous diagnosticgoto_prev_diag
]dGo to next diagnosticgoto_next_diag
[DGo to first diagnostic in documentgoto_first_diag
]DGo to last diagnostic in documentgoto_last_diag
[spaceAdd newline aboveadd_newline_above
]spaceAdd newline belowadd_newline_below

Insert Mode

KeyDescriptionCommand
EscapeSwitch to normal modenormal_mode
Ctrl-xAutocompletecompletion
Ctrl-wDelete previous worddelete_word_backward

Select / extend mode

I'm still pondering whether to keep this mode or not. It changes movement commands (including goto) to extend the existing selection instead of replacing it.

NOTE: It's a bit confusing at the moment because extend hasn't been implemented for all movement commands yet.

Picker

Keys to use within picker. Remapping currently not supported.

KeyDescription
Up, Ctrl-pPrevious entry
Down, Ctrl-nNext entry
Ctrl-spaceFilter options
EnterOpen selected
Ctrl-hOpen horizontally
Ctrl-vOpen vertically
Escape, Ctrl-cClose picker