helix

default keybinds — selection-first modal editing

keybinds

selection-first: actions act on the current selection, which is also the cursor. press Esc to return to normal mode from anywhere. (LSP) requires a language server, (TS) requires a tree-sitter grammar.

movement (normal mode)

keydescriptioncommand
h,LeftMove leftmove_char_left
j,DownMove downmove_visual_line_down
k,UpMove upmove_visual_line_up
l,RightMove rightmove_char_right
wNext word startmove_next_word_start
bPrevious word startmove_prev_word_start
eNext word endmove_next_word_end
WNext WORD startmove_next_long_word_start
BPrevious WORD startmove_prev_long_word_start
ENext WORD endmove_next_long_word_end
fFind next char (whole doc, not just line)find_next_char
tFind till next charfind_till_char
FFind previous charfind_prev_char
TFind till previous chartill_prev_char
GGo to line numbergoto_line
Alt-.Repeat last motion (f, t, m, [ or ])repeat_last_motion
HomeStart of linegoto_line_start
EndEnd of linegoto_line_end
Ctrl-b,PgUpPage uppage_up
Ctrl-f,PgDnPage downpage_down
Ctrl-uCursor + half page uppage_cursor_half_up
Ctrl-dCursor + half page downpage_cursor_half_down
Ctrl-iJump forward (jumplist)jump_forward
Ctrl-oJump backward (jumplist)jump_backward
Ctrl-sSave selection to jumplistsave_selection

changes

keydescriptioncommand
rReplace with a characterreplace
RReplace with yanked textreplace_with_yanked
~Switch case of selectionswitch_case
`Lowercase selectionswitch_to_lowercase
Alt-`Uppercase selectionswitch_to_uppercase
iInsert before selectioninsert_mode
aInsert after selection (append)append_mode
IInsert at line startinsert_at_line_start
AInsert at line endinsert_at_line_end
oOpen line belowopen_below
OOpen line aboveopen_above
.Repeat last insertN/A
uUndoundo
URedoredo
Alt-uEarlier in historyearlier
Alt-ULater in historylater
yYank selectionyank
pPaste afterpaste_after
PPaste beforepaste_before
"Select register to yank/pasteselect_register
>Indentindent
<Unindentunindent
=Format selection (LSP)format_selections
dDelete selectiondelete_selection
Alt-dDelete without yankingdelete_selection_noyank
cChange selection (delete + insert)change_selection
Alt-cChange without yankingchange_selection_noyank
Ctrl-aIncrement number under cursorincrement
Ctrl-xDecrement number under cursordecrement
QStart/stop macro recordingrecord_macro
qReplay recorded macroreplay_macro

shell

keydescriptioncommand
|Pipe each selection through shell, replace with outputshell_pipe
Alt-|Pipe through shell, ignore outputshell_pipe_to
!Insert shell output before each selectionshell_insert_output
Alt-!Append shell output after each selectionshell_append_output
$Pipe to shell, keep selections where exit code 0shell_keep_pipe

selection manipulation

keydescriptioncommand
sSelect all regex matches inside selectionsselect_regex
SSplit selection on regex matchessplit_selection
Alt-sSplit selection on newlinessplit_selection_on_newline
Alt--Merge selectionsmerge_selections
&Align selection in columnsalign_selections
_Trim whitespace from selectiontrim_selections
;Collapse selection to single cursorcollapse_selection
Alt-;Flip cursor and anchorflip_selections
,Keep only primary selectionkeep_primary_selection
Alt-,Remove primary selectionremove_primary_selection
CCopy selection to next line (cursor below)copy_selection_on_next_line
Alt-CCopy selection to prev line (cursor above)copy_selection_on_prev_line
(Rotate main selection backwardrotate_selections_backward
)Rotate main selection forwardrotate_selections_forward
%Select entire fileselect_all
xSelect current line (extend down if repeated)extend_line_below
XExtend selection to line boundsextend_to_line_bounds
JJoin lines inside selectionjoin_selections
Ctrl-cToggle commenttoggle_comments
Alt-o,Alt-UpExpand to parent syntax node (TS)expand_selection
Alt-i,Alt-DownShrink syntax node (TS)shrink_selection
Alt-p,Alt-LeftPrevious sibling node (TS)select_prev_sibling
Alt-n,Alt-RightNext sibling node (TS)select_next_sibling

search

operates on the / register by default; use " to pick another.

keydescriptioncommand
/Search for regex patternsearch
?Search for previous patternrsearch
nNext search matchsearch_next
NPrevious search matchsearch_prev
*Use selection as pattern (word-boundary aware)search_selection_detect_word_boundaries
Alt-*Use selection as patternsearch_selection

minor modes

keydescriptioncommand
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

view mode (z)

scroll/view adjustments without moving the selection. Z is the sticky variant (Esc to exit).

keydescriptioncommand
z,cVertically center the linealign_view_center
tAlign line to top of screenalign_view_top
bAlign line to bottom of screenalign_view_bottom
mAlign line to middle (horizontal)align_view_middle
j,downScroll view downwardsscroll_down
k,upScroll view upwardsscroll_up
Ctrl-fPage downpage_down
Ctrl-bPage uppage_up

goto mode (g)

keydescriptioncommand
gGo to line number, else start of filegoto_file_start
eEnd of filegoto_last_line
fGo to files in selectionsgoto_file
hStart of linegoto_line_start
lEnd of linegoto_line_end
sFirst non-whitespace char of linegoto_first_nonwhitespace
tTop of the screengoto_window_top
cMiddle of the screengoto_window_center
bBottom of the screengoto_window_bottom
dGo to definition (LSP)goto_definition
yGo to type definition (LSP)goto_type_definition
rGo to references (LSP)goto_reference
iGo to implementation (LSP)goto_implementation
aLast accessed (alternate) filegoto_last_accessed_file
mLast modified (alternate) filegoto_last_modified_file
nNext buffergoto_next_buffer
pPrevious buffergoto_previous_buffer
.Last modification in current filegoto_last_modification
wLabel every word; jump to labelgoto_word

match mode (m)

surround and textobject operations take an argument (e.g. m s ().

keydescriptioncommand
mGo to matching bracket (TS)match_brackets
s <ch>Surround current selection with <ch>surround_add
r <a> <b>Replace surround <a> with <b>surround_replace
d <ch>Delete surround <ch>surround_delete
a <obj>Select around textobjectselect_textobject_around
i <obj>Select inside textobjectselect_textobject_inner

window mode (Ctrl-w)

keydescriptioncommand
w,Ctrl-wSwitch to next windowrotate_view
v,Ctrl-vVertical right splitvsplit
s,Ctrl-sHorizontal bottom splithsplit
h,Ctrl-h,LeftMove to left splitjump_view_left
j,Ctrl-j,DownMove to split belowjump_view_down
k,Ctrl-k,UpMove to split abovejump_view_up
l,Ctrl-l,RightMove to right splitjump_view_right
q,Ctrl-qClose current windowwclose
o,Ctrl-oClose all windows but this onewonly
HSwap window to the leftswap_view_left
JSwap window downwardsswap_view_down
KSwap window upwardsswap_view_up
LSwap window to the rightswap_view_right

space mode (Space)

mostly pickers and LSP actions (a kludge layer).

keydescriptioncommand
fFile picker (workspace root)file_picker
FFile picker (current working dir)file_picker_in_current_directory
bBuffer pickerbuffer_picker
jJumplist pickerjumplist_picker
kHover documentation (LSP)hover
sDocument symbol picker (LSP)symbol_picker
SWorkspace symbol picker (LSP)workspace_symbol_picker
dDocument diagnostics (LSP)diagnostics_picker
DWorkspace diagnostics (LSP)workspace_diagnostics_picker
rRename symbol (LSP)rename_symbol
aApply code action (LSP)code_action
wEnter window modeN/A
cToggle commenttoggle_comments
yYank to clipboardyank_to_clipboard
pPaste clipboard afterpaste_clipboard_after
PPaste clipboard beforepaste_clipboard_before
'Open last fuzzy pickerlast_picker

insert mode

minimal by design — changes are only checkpointed for undo on return to normal mode.

keydescriptioncommand
EscSwitch to normal modenormal_mode
Ctrl-sCommit undo checkpointcommit_undo_checkpoint
Ctrl-xAutocompletecompletion
Ctrl-rInsert register contentinsert_register
Ctrl-w,Alt-BkspDelete previous worddelete_word_backward
Alt-dDelete next worddelete_word_forward
Ctrl-uDelete to start of linekill_to_line_start
Ctrl-kDelete to end of linekill_to_line_end
Ctrl-hDelete previous chardelete_char_backward
Ctrl-dDelete next chardelete_char_forward

picker & prompt

navigation within the fuzzy picker (and the : command prompt).

keydescriptioncommand
Up,Ctrl-pPrevious itemfocus_previous
Down,Ctrl-nNext itemfocus_next
Ctrl-uScroll preview upscroll_up
Ctrl-dScroll preview downscroll_down
EnterConfirm selectionselect_input
Esc,Ctrl-cCancelclose
Ctrl-hDelete previous chardelete_char_backward
Ctrl-wDelete previous worddelete_word_backward
Ctrl-rInsert register contentinsert_register