on 39d5921 help sign in
helix/book/src/remapping.md
50 lines 1.8 kB history raw
1# Key Remapping
3One-way key remapping is temporarily supported via a simple TOML configuration
4file. (More powerful solutions such as rebinding via commands will be
5available in the feature).
7To remap keys, write a `config.toml` file in your `helix` configuration
8directory (default `~/.config/helix` in Linux systems) with a structure like
9this:
11```toml
12# At most one section each of 'keys.normal', 'keys.insert' and 'keys.select'
13[keys.normal]
14a = "move_char_left" # Maps the 'a' key to the move_char_left command
15w = "move_line_up" # Maps the 'w' key move_line_up
16C-S-esc = "select_line" # Maps Control-Shift-Escape to select_line
18[keys.insert]
19A-x = "normal_mode" # Maps Alt-X to enter normal mode
20```
22Control, Shift and Alt modifiers are encoded respectively with the prefixes
23`C-`, `S-` and `A-`. Special keys are encoded as follows:
25| Key name | Representation |
26| --- | --- |
27| Backspace | `"backspace"` |
28| Space | `"space"` |
29| Return/Enter | `"ret"` |
30| < | `"lt"` |
31| \> | `"gt"` |
32| \+ | `"plus"` |
33| \- | `"minus"` |
34| ; | `"semicolon"` |
35| % | `"percent"` |
36| Left | `"left"` |
37| Right | `"right"` |
38| Up | `"up"` |
39| Home | `"home"` |
40| End | `"end"` |
41| Page | `"pageup"` |
42| Page | `"pagedown"` |
43| Tab | `"tab"` |
44| Back | `"backtab"` |
45| Delete | `"del"` |
46| Insert | `"ins"` |
47| Null | `"null"` |
48| Escape | `"esc"` |
50Commands can be found in the source code at [`helix-term/src/commands.rs`](https://github.com/helix-editor/helix/blob/master/helix-term/src/commands.rs)