Skip to content

Instantly share code, notes, and snippets.

@7ombie
Last active March 7, 2024 03:16
Show Gist options
  • Save 7ombie/87c1ebd8ad58ec405abf68d51ad3433d to your computer and use it in GitHub Desktop.
Save 7ombie/87c1ebd8ad58ec405abf68d51ad3433d to your computer and use it in GitHub Desktop.
Backup of current Helix bindings (work in progress - see docs below config file).
[keys.insert]
S-ret = "commit_undo_checkpoint"
S-tab = "completion"
A-up = "expand_selection"
A-down = "shrink_selection"
A-left = "select_prev_sibling"
A-right = "select_next_sibling"
A-S-up = "switch_to_uppercase"
A-S-down = "switch_to_lowercase"
A-S-left = "decrement"
A-S-right = "increment"
S-right = "indent"
S-left = "unindent"
S-up = [ # scroll selections up one line
"ensure_selections_forward",
"extend_to_line_bounds",
"extend_char_right",
"extend_char_left",
"delete_selection",
"move_line_up",
"add_newline_above",
"move_line_up",
"replace_with_yanked"
]
S-down = [ # scroll selections down one line
"ensure_selections_forward",
"extend_to_line_bounds",
"extend_char_right",
"extend_char_left",
"delete_selection",
"add_newline_below",
"move_line_down",
"replace_with_yanked"
]
C-A-b = "goto_next_paragraph" # blocks and paragraphs
C-A-B = "goto_prev_paragraph"
C-A-c = "goto_next_comment" # comments
C-A-C = "goto_prev_comment"
C-A-d = "goto_next_diag" # diagnostics
C-A-D = "goto_prev_diag"
C-A-e = "goto_next_change" # edits
C-A-E = "goto_prev_change"
C-A-f = "goto_next_function" # functions
C-A-F = "goto_prev_function"
C-A-h = "earlier" # history (newest edits on top)
C-A-H = "later"
C-A-j = "jump_backward" # jumplist (newest entries on top)
C-A-J = "jump_forward"
C-A-t = "goto_next_class" # type-definitions
C-A-T = "goto_prev_class"
C-A-p = "goto_next_parameter" # parameters and arguments
C-A-P = "goto_prev_parameter"
C-A-u = "goto_next_test" # unit tests
C-A-U = "goto_prev_test"
C-A-ret = "save_selection" # save selection to the jumplist
pageup = "half_page_up"
pagedown = "half_page_down"
home = "goto_first_nonwhitespace"
end = "goto_line_end"
S-pageup = "page_up"
S-pagedown = "page_down"
C-pageup = ":goto 1" # regress to first line
C-pagedown = ":goto 4290000000" # advance to last line
C-home = "goto_line_start" # goto very start of line
C-end = "goto_line_end_newline" # goto very end of line
A-backspace = ["extend_prev_word_start", "delete_selection_noyank"] # delete to beginning of word
A-del = ["extend_next_word_end", "delete_selection_noyank"] # delete to end of word
A-S-backspace = ["extend_prev_long_word_start", "delete_selection_noyank"] # delete to beginning of longword
A-S-del = ["extend_next_long_word_end", "delete_selection_noyank"] # delete to end of longword
C-backspace = "kill_to_line_start"
C-del = "kill_to_line_end"
C-S-backspace = [ # delete to beginning of file
"kill_to_line_start",
"move_visual_line_up",
"select_mode",
":goto 1",
"extend_to_line_bounds",
"delete_selection_noyank",
"insert_mode"
]
C-S-del = [ # delete to end of file
"kill_to_line_end",
"move_visual_line_down",
"select_mode",
":goto 4290000000",
"extend_to_line_bounds",
"delete_selection_noyank",
"insert_mode",
"move_char_left"
]
C-left = "goto_previous_buffer"
C-right = "goto_next_buffer"
C-A-up = "jump_view_up"
C-A-down = "jump_view_down"
C-A-left = "jump_view_left"
C-A-right = "jump_view_right"
C-A-S-up = "swap_view_up"
C-A-S-down = "swap_view_down"
C-A-S-left = "swap_view_left"
C-A-S-right = "swap_view_right"
C-h = "hsplit"
C-H = "hsplit_new"
C-q = "wclose"
C-Q = "wonly"
C-v = "vsplit"
C-V = "vsplit_new"
"C-." = "rotate_view"
C-d = "no_op"
C-j = "no_op"
C-k = "no_op"
C-r = "no_op"
C-s = "no_op"
C-u = "no_op"
C-w = "no_op"
C-x = "no_op"
S-backspace = "no_op"
[keys.normal]
esc = "select_mode"
ret = "command_mode"
backspace = "delete_selection_noyank"
A-up = "expand_selection"
A-down = "shrink_selection"
A-left = "select_prev_sibling"
A-right = "select_next_sibling"
A-S-up = "switch_to_uppercase"
A-S-down = "switch_to_lowercase"
A-S-left = "decrement"
A-S-right = "increment"
S-backspace = ["delete_selection_noyank", "insert_mode"] # discard selections, then edit
S-up = [
"ensure_selections_forward",
"extend_to_line_bounds",
"extend_char_right",
"extend_char_left",
"delete_selection",
"move_line_up",
"add_newline_above",
"move_line_up",
"replace_with_yanked"
]
S-down = [
"ensure_selections_forward",
"extend_to_line_bounds",
"extend_char_right",
"extend_char_left",
"delete_selection",
"add_newline_below",
"move_line_down",
"replace_with_yanked"
]
S-left = "unindent"
S-right = "indent"
C-A-b = "goto_next_paragraph"
C-A-B = "goto_prev_paragraph"
C-A-c = "goto_next_comment"
C-A-C = "goto_prev_comment"
C-A-d = "goto_next_diag"
C-A-D = "goto_prev_diag"
C-A-e = "goto_next_change"
C-A-E = "goto_prev_change"
C-A-f = "goto_next_function"
C-A-F = "goto_prev_function"
C-A-h = "earlier"
C-A-H = "later"
C-A-j = "jump_backward"
C-A-J = "jump_forward"
C-A-t = "goto_next_class"
C-A-T = "goto_prev_class"
C-A-p = "goto_next_parameter"
C-A-P = "goto_prev_parameter"
C-A-u = "goto_next_test"
C-A-U = "goto_prev_test"
C-A-ret = "save_selection"
pageup = "half_page_up"
pagedown = "half_page_down"
home = "goto_first_nonwhitespace"
end = "goto_line_end"
S-pageup = "page_up"
S-pagedown = "page_down"
C-pageup = ":goto 1"
C-pagedown = ":goto 4290000000"
C-home = "goto_line_start"
C-end = "goto_line_end_newline"
A-backspace = ["extend_prev_word_start", "delete_selection_noyank"]
A-del = ["extend_next_word_end", "delete_selection_noyank"]
A-S-backspace = ["extend_prev_long_word_start", "delete_selection_noyank"]
A-S-del = ["extend_next_long_word_end", "delete_selection_noyank"]
C-backspace = "kill_to_line_start"
C-del = "kill_to_line_end"
C-S-backspace = [
"kill_to_line_start",
"move_visual_line_up",
"select_mode",
":goto 1",
"extend_to_line_bounds",
"delete_selection_noyank",
"normal_mode"
]
C-S-del = [
"kill_to_line_end",
"move_visual_line_down",
"select_mode",
":goto 4290000000",
"extend_to_line_bounds",
"delete_selection_noyank",
"move_char_left",
"normal_mode"
]
C-left = "goto_previous_buffer"
C-right = "goto_next_buffer"
C-A-up = "jump_view_up"
C-A-down = "jump_view_down"
C-A-left = "jump_view_left"
C-A-right = "jump_view_right"
C-A-S-up = "swap_view_up"
C-A-S-down = "swap_view_down"
C-A-S-left = "swap_view_left"
C-A-S-right = "swap_view_right"
C-h = "hsplit"
C-H = "hsplit_new"
C-q = "wclose"
C-Q = "wonly"
C-v = "vsplit"
C-V = "vsplit_new"
"C-." = "rotate_view"
minus = "remove_primary_selection"
"=" = "keep_primary_selection"
"[" = "rotate_selections_backward"
"]" = "rotate_selections_forward"
"{" = "rotate_selection_contents_backward"
"}" = "rotate_selection_contents_forward"
";" = "split_selection_on_newline"
":" = "align_selections"
"$" = "select_references_to_symbol_under_cursor"
"," = "repeat_last_motion"
"#" = "toggle_comments"
"?" = "search_selection"
"<" = "search_prev"
">" = "search_next"
"^" = "rsearch"
"`" = "select_register"
"~" = "insert_register"
"\"" = "record_macro"
"'" = "replay_macro"
"_" = "shell_pipe_to"
"\\" = "shell_pipe"
"|" = "shell_keep_pipe"
"(" = "shell_insert_output"
")" = "shell_append_output"
"*" = "command_palette"
"+" = "hover"
"&" = "code_action"
"@" = "format_selections"
"!" = "last_picker"
c = "copy_selection_on_next_line"
C = "copy_selection_on_prev_line"
d = "collapse_selection"
D = "no_op"
f = "flip_selections"
F = "ensure_selections_forward"
g = "goto_line"
G = "no_op"
h = "join_selections"
H = "join_selections_space"
j = "merge_consecutive_selections"
J = "merge_selections"
k = "keep_selections"
K = "remove_selections"
l = "extend_line_below"
L = "extend_line_above"
M = "no_op"
n = ["open_below", "normal_mode"] # open a new line without leaving normal mode
N = "open_below" # open a new line, then edit it
o = "find_next_char"
O = "find_prev_char"
p = "paste_before"
P = ["paste_before", "append_mode"]
q = ":buffer-close"
Q = ":quit"
v = "trim_selections"
V = "no_op"
w = ["move_prev_word_start", "move_next_word_end"]
W = ["move_prev_long_word_start", "move_next_long_word_end"]
x = "delete_selection"
X = ["delete_selection", "insert_mode"]
Y = "yank_joined"
z = "no_op"
Z = "no_op"
C-a = "no_op"
C-b = "no_op"
C-c = "no_op"
C-f = "no_op"
C-i = "no_op"
C-o = "no_op"
C-s = "no_op"
C-u = "no_op"
C-w = "no_op"
C-x = "no_op"
A-s = "no_op"
A-u = "no_op"
A-x = "no_op"
A-o = "no_op"
A-i = "no_op"
A-n = "no_op"
A-K = "no_op"
A-U = "no_op"
"A-." = "no_op"
"A-`" = "no_op"
"A-|" = "no_op"
"A-!" = "no_op"
"A-minus" = "no_op"
"A-_" = "no_op"
"A-:" = "no_op"
"A-;" = "no_op"
"A-," = "no_op"
"A-(" = "no_op"
"A-)" = "no_op"
[keys.normal.space]
"'" = "no_op"
"?" = "no_op"
a = "no_op"
g = "no_op"
h = "no_op"
k = "no_op"
p = "no_op"
P = "no_op"
w = "no_op"
Y = "no_op"
[keys.normal.m]
a = "no_op"
i = "no_op"
[keys.select]
ret = "command_mode"
backspace = "delete_selection_noyank"
A-up = "expand_selection"
A-down = "shrink_selection"
A-left = "select_prev_sibling"
A-right = "select_next_sibling"
A-S-up = ["switch_to_uppercase", "select_mode"]
A-S-down = ["switch_to_lowercase", "select_mode"]
A-S-left = ["decrement", "select_mode"]
A-S-right = ["increment", "select_mode"]
S-backspace = ["delete_selection_noyank", "insert_mode"]
S-up = [
"ensure_selections_forward",
"extend_to_line_bounds",
"extend_char_right",
"extend_char_left",
"delete_selection",
"move_line_up",
"add_newline_above",
"move_line_up",
"replace_with_yanked"
]
S-down = [
"ensure_selections_forward",
"extend_to_line_bounds",
"extend_char_right",
"extend_char_left",
"delete_selection",
"add_newline_below",
"move_line_down",
"replace_with_yanked"
]
S-left = "unindent"
S-right = "indent"
C-A-b = "goto_next_paragraph"
C-A-B = "goto_prev_paragraph"
C-A-c = "goto_next_comment"
C-A-C = "goto_prev_comment"
C-A-d = "goto_next_diag"
C-A-D = "goto_prev_diag"
C-A-e = "goto_next_change"
C-A-E = "goto_prev_change"
C-A-f = "goto_next_function"
C-A-F = "goto_prev_function"
C-A-h = "earlier"
C-A-H = "later"
C-A-j = "jump_backward"
C-A-J = "jump_forward"
C-A-t = "goto_next_class"
C-A-T = "goto_prev_class"
C-A-p = "goto_next_parameter"
C-A-P = "goto_prev_parameter"
C-A-u = "goto_next_test"
C-A-U = "goto_prev_test"
C-A-ret = "save_selection"
pageup = "half_page_up"
pagedown = "half_page_down"
home = "goto_first_nonwhitespace"
end = "goto_line_end"
S-pageup = "page_up"
S-pagedown = "page_down"
C-pageup = ":goto 1"
C-pagedown = ":goto 4290000000"
C-home = "goto_line_start"
C-end = "goto_line_end_newline"
A-backspace = ["extend_prev_word_start", "delete_selection_noyank"]
A-del = ["extend_next_word_end", "delete_selection_noyank"]
A-S-backspace = ["extend_prev_long_word_start", "delete_selection_noyank"]
A-S-del = ["extend_next_long_word_end", "delete_selection_noyank"]
C-backspace = "kill_to_line_start"
C-del = "kill_to_line_end"
C-S-backspace = [
"normal_mode",
"kill_to_line_start",
"move_visual_line_up",
"select_mode",
":goto 1",
"extend_to_line_bounds",
"delete_selection_noyank",
"select_mode"
]
C-S-del = [
"normal_mode",
"kill_to_line_end",
"move_visual_line_down",
"select_mode",
":goto 4290000000",
"extend_to_line_bounds",
"delete_selection_noyank",
"move_char_left",
"select_mode"
]
C-left = "goto_previous_buffer"
C-right = "goto_next_buffer"
C-A-up = "jump_view_up"
C-A-down = "jump_view_down"
C-A-left = "jump_view_left"
C-A-right = "jump_view_right"
C-A-S-up = "swap_view_up"
C-A-S-down = "swap_view_down"
C-A-S-left = "swap_view_left"
C-A-S-right = "swap_view_right"
C-h = "hsplit"
C-H = "hsplit_new"
C-q = "wclose"
C-Q = "wonly"
C-v = "vsplit"
C-V = "vsplit_new"
"C-." = "rotate_view"
minus = "remove_primary_selection"
"=" = "keep_primary_selection"
"[" = "rotate_selections_backward"
"]" = "rotate_selections_forward"
"{" = "rotate_selection_contents_backward"
"}" = "rotate_selection_contents_forward"
";" = "split_selection_on_newline"
":" = "align_selections"
"$" = "select_references_to_symbol_under_cursor"
"," = "repeat_last_motion"
"#" = ["toggle_comments", "select_mode"]
"?" = "search_selection"
"<" = "search_prev"
">" = "search_next"
"^" = "rsearch"
"`" = "select_register"
"~" = "insert_register"
"\"" = "record_macro"
"'" = "replay_macro"
"_" = "shell_pipe_to"
"\\" = "shell_pipe"
"|" = "shell_keep_pipe"
"(" = "shell_insert_output"
")" = "shell_append_output"
"*" = "command_palette"
"+" = "hover"
"&" = "code_action"
"@" = "format_selections"
"!" = "last_picker"
c = "copy_selection_on_next_line"
C = "copy_selection_on_prev_line"
d = "collapse_selection"
D = "no_op"
f = "flip_selections"
F = "ensure_selections_forward"
g = "goto_line"
G = "no_op"
h = "join_selections"
H = "join_selections_space"
j = "merge_consecutive_selections"
J = "merge_selections"
k = "keep_selections"
K = "remove_selections"
l = "extend_line_below"
L = "extend_line_above"
M = "no_op"
n = ["open_below", "normal_mode", "select_mode"] # do not auto-indent (as not inserting)
N = "open_below"
o = "find_next_char"
O = "find_prev_char"
p = "paste_before"
P = ["paste_before", "append_mode"]
q = ":buffer-close"
Q = ":quit"
v = "trim_selections"
V = "no_op"
w = ["move_prev_word_start", "move_next_word_end"]
W = ["move_prev_long_word_start", "move_next_long_word_end"]
x = "delete_selection"
X = ["delete_selection", "insert_mode"]
y = ["yank", "select_mode"] # stay in select mode after pasting
Y = "yank_joined"
z = "no_op"
Z = "no_op"
C-a = "no_op"
C-b = "no_op"
C-c = "no_op"
C-f = "no_op"
C-i = "no_op"
C-o = "no_op"
C-s = "no_op"
C-u = "no_op"
C-w = "no_op"
C-x = "no_op"
A-s = "no_op"
A-u = "no_op"
A-x = "no_op"
A-o = "no_op"
A-i = "no_op"
A-n = "no_op"
A-K = "no_op"
A-U = "no_op"
"A-." = "no_op"
"A-`" = "no_op"
"A-|" = "no_op"
"A-!" = "no_op"
"A-minus" = "no_op"
"A-_" = "no_op"
"A-:" = "no_op"
"A-;" = "no_op"
"A-," = "no_op"
"A-(" = "no_op"
"A-)" = "no_op"
[keys.select.space]
"'" = "no_op"
"?" = "no_op"
a = "no_op"
g = "no_op"
h = "no_op"
k = "no_op"
p = "no_op"
P = "no_op"
w = "no_op"
Y = "no_op"
[keys.select.m]
a = "no_op"
i = "no_op"

FREESTYLE HELIX

This doc summarizes my ideal Helix keybindings, which are optimized for freestyle typing (rather than touch typing), prioritizing consistent mnemonics that are easy to remember (and deliberately recall), instead of proximity to the home row (with a reliance on muscle memory).

Most of the bindings in this doc are implemented by the config file above. However, there are some exceptions (which are documented below).

INSERT MODE

Insert Mode uses Escape to active Normal Mode, though Escape can also be double-tapped to reach Select Mode:

  • Escape Normal Mode.
  • EscapeEscape Select Mode.

Otherwise, Insert Mode only has a couple of unique (and non-obvious) keybindings:

  • ShiftEnter Commit undo checkpoint.
  • ShiftTab Activate completer.

NORMAL MODE & SELECT MODE

The bindings for Normal Mode and Select Mode are effectively identical:

  • Escape Toggle between Normal and Select Mode.
  • Enter Focus the command line (double-tap to rerun last command).

The following bindings introduce a convention: The Shift modifier is used to insert (or append) after an operation:

  • Backspace Discard selections (delete without yanking).
  • ShiftBackspace Discard selections, then insert.

Note: Some commands have been slightly modified to prevent Helix from implicitly switching from Select Mode to Normal Mode when deleting, pasting, adding newlines etc.

Selection

The following operators (non-alphanumeric, printable glyphs) are used for manipulating selections:

  • % Select the entire buffer.
  • $ Select all references to the symbol under the cursor.
  • - Drop the primary selection.
  • = Drop all secondary selections.
  • [ Regress the primary cursor (to the prior secondary).
  • ] Advance the primary cursor (to the next secondary).
  • { Regress the primary selection contents.
  • } Advance the primary selection contents.
  • ; Split selections on newlines.
  • : Vertically align selections.

Redos

These operators are used for repeating actions:

  • . Repeat last insert.
  • , Repeat last motion.

Searching

These operators are used for searching the buffer:

  • / Search for regex.
  • ? Search for primary selection contents.
  • < Select prior search result.
  • > Select next search result.
  • ^ Search for previous regex again.

Registers & Macros

These operators are used for working with registers and macros:

  • ` Activate register named char.
  • ~ Insert contents of register named char.
  • " Record Macro.
  • ' Play Macro.

The Shell

These operators are used for working with the system shell:

  • _ Pipe selections into command, ignoring results.
  • \ Pipe selections into command, unconditionally replacing selections with the output.
  • | Pipe selections into command, conditionally keeping selections only when result is 0.
  • ( Run command, inserting result to selections.
  • ) Run command, appending result to selections.

Miscellaneous Operators

There are a handful of miscellaneous operator bindings:

  • * Open the Command Palette.
  • + More information (open a popup describing the token under the cursor).
  • & Authorize co-pilot (LSP/AI) to perform its suggested code action on the buffer.
  • @ Auto-format selections (relies on LSP linter/formatter, once the feature is available in Helix):
  • ! Reopen last picker (restoring the state that the picker had when it was last escaped from).
  • # Toggle commentary.

Assorted Alphas

There are no unused operators. Likewise, there are no unused alphas:

  • a Append to selections.
  • A Append to selected lines.
  • b Select to beginning of word.
  • B Select to beginning of longword.
  • c Add cursor, advancing.
  • C Add cursor, regressing.
  • d Deselect (collapse) selections.
  • D DAP Menu (debugging).
  • e Select to end of word.
  • E Select to end of longword.
  • f Flip selections (swapping cursor and anchor).
  • F Forward selections (ensuring cursors are forward of anchors).
  • g Goto line (taking lineno from the repetitions buffer).
  • G Goto Menu (revised).
  • h Hitch selected lines (to the lines above them, joining with spaces).
  • H Hitch and select hitches.
  • i Insert to selections.
  • I Insert to selected lines.
  • j Join consecutive selections.
  • J Join selections, bridging any gaps.
  • k Keep selections that contain regex.
  • K Keep selections that do not contain regex.
  • l Select line, advancing.
  • L Select line, regressing.
  • m Match Menu (simplified).
  • M Make Menu (run Makefiles).
  • n Insert newline.
  • N Insert newline, then edit.
  • o Advance cursor onto char.
  • O Regress cursor onto char.
  • p Paste (normally - before the cursor).
  • P Paste, then edit (appending).
  • q Quit editing current buffer (requiring that it's saved).
  • Q Quit Helix (requiring that all open buffers are saved).
  • r Replace each character in selections with char.
  • R Replace selections with register.
  • s Select matches for regex (within current selections).
  • S Split selections on regex.
  • t Advance cursor till char.
  • T Regress cursor till char.
  • u Undo.
  • U Undo undo.
  • v Keep visible line (trim leading and trailing whitespace).
  • V VCS Menu (git commands).
  • w Select whole word.
  • W Select whole longword.
  • x Cut (yank and delete) primary selection (discarding any secondary contents).
  • X Cut primary selection, then edit.
  • y Yank primary selection.
  • Y Yank all selections, and join with newlines.
  • z Zerk Menu (user customization, themes, scripts etc).
  • Z Zen Mode (a revised, sticky view mode).

DAP MENU

The DAP Menu has not been designed or implemented yet. It will contain a collection of debugging commands for working with DAP servers (similar to the old Space-Debug Submenu).

GOTO MENU

The Goto Menu will be revised, removing most of the (now redundant) defaults, and adding the following bindings, but it has not been implemented yet:

  • d Goto last diagnostic.
  • D Goto first diagnostic.
  • e Goto last edit.
  • E Goto first edit.
  • h Goto files in the selections in the horizontal splits (windowing).
  • v Goto files in the selections in the vertical splits (windowing).

Note: I'm not sure what h and v do exactly, but they were in the old Window Menu, so these bindings were reserved in case I need them.

MATCH MENU

The Match Menu has been simplified, reducing it to four bindings that perform the most common operations on (language-specific) pairs of surrounding characters:

  • m Goto the character that pairs with the character under the cursor.
  • r Replace nearest pair of char0 characters with char1 characters.
  • s Add a surrounding pair of char characters to current selections.
  • d Delete the nearest surrounding pair of char characters.

MAKE MENU

The Make Menu has not been implemented yet. It will contain commands for running Makefiles with common targets etc.

SPACE MENU

The Space Menu is relatively unchanged. It contains twelve bindings, mainly for accessing pickers and the system clipboard:

  • b Open the Buffer Picker.
  • d Open the Diagnostics Picker, scoped to the buffer.
  • D Open the Diagnostics Picker, scoped to the workspace.
  • f Open the File Picker.
  • F Open the File Picker in the current working directory.
  • j Open the Jumplist Picker.
  • s Open the Symbol Picker, scoped to the buffer.
  • S Open the Symbol Picker, scoped to the workspace.
  • r Rename symbol.
  • R Replace selections with content from the system clipboard.
  • y Yank selections to the system clipboard.
  • / Search for regex, scoped to workspace.

Note: The order of the items in the menu is currently determined by Helix (pending #9829).

VCS MENU

The VCS Menu will be used for version control (in practice, git commands). It has not been implemented yet.

ZERK MENU

The Zerk Menu is for customization, configuration, theming, scripting etc (go beserk). It is currently unimplemented.

  • c Reload Helix configuration.
  • t Reload theme.
  • o Open Menu (open files).

ZERK-OPEN SUBMENU

The Zerk-Open Submenu is for opening files associated with customization (note that local refers to the current working directory):

  • c Open global configuration file (~/.config/helix/config.toml).
  • C Open local configuration file (./.helix/config.toml).
  • t Open (global) theme (~/.config/helix/themes/config.theme).
  • i Open global ignore file (~/.config/helix/ignore).
  • I Open local ignore file (./.helix/ignore).
  • g Open global gitignore file (the core.excludesfile).
  • G Open local gitignore file (./.gitignore).
  • l Open global languages file (~/.config/helix/languages.toml).
  • L Open local languages file (./.helix/languages.toml).

ZEN MODE

Zen Mode will be a revised version of the old Sticky View Menu (like a reader-mode).

UNIVERSAL BINDINGS

The bindings described in this section use modifier keys, and are available in all three modes (Insert, Normal and Select).

Naturally, the bindings use dedicated cursor keys (the HJKL keys are never used for navigation).

Bufferline & Window Navigation

The Control chord is used with various letters for performing operations on windows:

  • Controlq Quit (close) current window.
  • ControlQ Quit all other windows.
  • Controlh Split using horizontal divider.
  • ControlH Split using horizontal divider, and open scratch buffer.
  • Controlv Split using vertical divider.
  • ControlV Split using vertical divider, and open scratch buffer.
  • Controlr Rotate to next window.

The same chord is used to move between buffers:

  • ControlLeft Regress to the previous buffer.
  • ControlRight Advance to the next buffer.

The Shift modifier modifies the previous bindings to move the buffer content (pending #3707):

  • ControlShiftLeft Move current buffer to the left.
  • ControlShiftRight Move current buffer to the right.

The Option modifier instead modifies the bindings to move between windows:

  • ControlOptionUp Move focus to the the split above.
  • ControlOptionDown Move focus to the the split below.
  • ControlOptionLeft Move focus to the the split to the left.
  • ControlOptionRight Move focus to the the split to the right.

And OptionShift is applied to move content between windows:

  • ControlOptionShiftUp Swap the current window upward.
  • ControlOptionShiftDown Swap the current window downwards.
  • ControlOptionShiftLeft Swap the current window leftwards.
  • ControlOptionShiftRight Swap the current window rightward.

Buffer Navigation

You can use the navigation keys to jump around by an inferred amount:

  • PageUp Move up half a page.
  • PageDown Move down half a page.
  • Home Move to the start of the visible line (the first visible character).
  • End Move till the end of the line (not including the newline character).

You can modify the above bindings using Shift to infer a larger jump up or down:

  • ShiftPageUp Move up one page.
  • ShiftPageDown Move down one page.

The Control modifier is used with the navigation keys to jump to the buffer extremes:

  • ControlHome Move to the start of the line (the very beginning).
  • ControlEnd Move to the end of the line (the newline).
  • ControlPageUp Move to the top of the file.
  • ControlPageDown Move to the bottom of the file.

Grammatical Buffer Navigation

These bindings infer where to move to, based on indentation (and are not curently implemented, pending #9819):

  • OptionPageUp Goto the next visible cell above (see #9819).
  • OptionPageDown Goto the next visible cell below.
  • OptionHome Goto the start of the leading line above (see #9819).
  • OptionEnd Goto the start of the first child line below (see #9819).

Grammatical Selection

These bindings adapt selections node-wise (using Tree-sitter):

  • OptionUp Expand selections out to parent node.
  • OptionDown Shrink selections (back) down to child node.
  • OptionLeft Regress selections to previous node.
  • OptionRight Advance selections to next node.

These bindings select everything inside a given construct (pending #9814):

  • Optionb Select inside the current block/paragraph.
  • Optionc Select inside the current comment
  • Optionf Select inside the current function.
  • Optionm Select inside the closest matching character-pair.
  • Optionp Select inside the current parameter/argument.
  • Optiont Select inside the current type-definition.
  • Optionu Select inside the current unit test.
  • Optionw Select inside the current word.
  • OptionW Select inside the current longword.
  • Option× Select inside the closest matching pair of × characters.

These bindings select everything around a given construct (pending #9814):

  • Controlb Select around the current block/paragraph.
  • Controlc Select around the current comment
  • Controlf Select around the current function.
  • Controlm Select around the closest matching character-pair.
  • Controlp Select around the current parameter/argument.
  • Controlt Select around the current type-definition.
  • Controlu Select around the current unit test.
  • Controlw Select around the current word.
  • ControlW Select around the current longword.
  • Control× Select around the closest matching pair of × characters.

The following bindings move to (and select) the next or previous item, treating the Edit History and Jumplist as a stack (with the newest stuff on top):

  • ControlOptionb Select next block/paragraph.
  • ControlOptionB Select previous block/paragraph.
  • ControlOptionc Select next comment.
  • ControlOptionC Select previous comment.
  • ControlOptiond Select next diagnostic.
  • ControlOptionD Select previous diagnostic.
  • ControlOptione Select next edit/change.
  • ControlOptionE Select previous edit/change.
  • ControlOptionf Select next function.
  • ControlOptionF Select previous function.
  • ControlOptionh Advance (down) through the Edit History, selecting the next (older) entry.
  • ControlOptionH Regress (back up) through the Edit History, selecting the previous (newer) entry.
  • ControlOptionj Advance (down) through the Jumplist, selecting the next (older) entry.
  • ControlOptionJ Regress (back up) through the Jumplist, selecting the previous (newer) entry.
  • ControlOptionp Select next parameter/argument.
  • ControlOptionP Select previous parameter/argument.
  • ControlOptiont Select next type-definition.
  • ControlOptionT Select previous type-definition.
  • ControlOptionu Select next unit test
  • ControlOptionU Select previous unit test.
  • ControlOptionEnter Save selection to the Jumplist.

Moving Selections

The Shift modifier is used with the cursor keys to move selections around (two-dimensionally):

  • ShiftUp Move selections up a line.
  • ShiftDown Move selections down a line.
  • ShiftLeft Lower indentation of selections one level.
  • ShiftRight Increase indentation of selections one level.

Mutating Selections

These bindings are for uppercasing, lowercasing, incrementing and decrementing selections:

  • OptionShiftUp Make selection contents uppercase.
  • OptionShiftDown Make selection contents lowercase.
  • OptionShiftLeft Decrement selection contents.
  • OptionShiftRight Increment selection contents.

Deleting Words & Lines

The Option modifier is used with Backspace and Delete to delete words:

  • OptionBackspace Delete (no yank) to the start of the current word.
  • OptionDelete Delete to the end of the current word.
  • OptionShiftBackspace Delete to the start of the current longword.
  • OptionShiftDelete Delete to the end of the current longword.

The Control modifier is used similarly for linewise deletions:

  • ControlBackspace Delete to the start of the line.
  • ControlDelete Delete to the end of the line.
  • ControlShiftBackspace Delete to the start of the file.
  • ControlShiftDelete Delete to the end of the file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment