Step 5 of 6

Remapping keys

Remapping keys

The same file holds your key remaps. Each mode gets its own section — [keys.normal], [keys.insert], [keys.select] — and each line maps a key to a command name:

[keys.normal]
C-s = ":w"

A key can also open a nested table, which turns it into a prefix. This is how you get the classic jk to leave insert mode:

[keys.insert]
j = { k = "normal_mode" }

Helix waits after j to see whether k follows; anything else inserts the j as usual.

Two kinds of command can go on the right-hand side. Anything you can type at the prompt works, written with its colon (":w"). Bare names like normal_mode or extend_line are the editor commands that keys are bound to out of the box; the Helix keymap documentation lists every one.

Work through the checklist below to add the jk map and prove it works.

  1. Open your config with :config-open At the : prompt.
  2. Add a [keys.insert] section mapping jk to normal_mode Add the two lines shown above at the end of the file, then select the last one.
  3. Save it with :w At the : prompt.
  4. Reload, then leave insert mode with jk Reload the config, then go into insert mode and type jk — you're back in normal mode without touching Escape.
Open your config with :config-open At the : prompt.

Next: Add a [keys.insert] section mapping jk to normal_mode

Loading editor…