Update book to include typable command remapping (#1240)
* Update book to include typable command remapping * Add additional example
This commit is contained in:
parent
29c053e84e
commit
a1e64815cb
@ -11,6 +11,8 @@ # Key Remapping
|
|||||||
```toml
|
```toml
|
||||||
# At most one section each of 'keys.normal', 'keys.insert' and 'keys.select'
|
# At most one section each of 'keys.normal', 'keys.insert' and 'keys.select'
|
||||||
[keys.normal]
|
[keys.normal]
|
||||||
|
C-s = ":w" # Maps the Control-s to the typable command :w which is an alias for :write (save file)
|
||||||
|
C-o = ":open ~/.config/helix/config.toml" # Maps the Control-o to opening of the helix config file
|
||||||
a = "move_char_left" # Maps the 'a' key to the move_char_left command
|
a = "move_char_left" # Maps the 'a' key to the move_char_left command
|
||||||
w = "move_line_up" # Maps the 'w' key move_line_up
|
w = "move_line_up" # Maps the 'w' key move_line_up
|
||||||
"C-S-esc" = "extend_line" # Maps Control-Shift-Escape to extend_line
|
"C-S-esc" = "extend_line" # Maps Control-Shift-Escape to extend_line
|
||||||
@ -21,6 +23,7 @@ # At most one section each of 'keys.normal', 'keys.insert' and 'keys.select'
|
|||||||
"A-x" = "normal_mode" # Maps Alt-X to enter normal mode
|
"A-x" = "normal_mode" # Maps Alt-X to enter normal mode
|
||||||
j = { k = "normal_mode" } # Maps `jk` to exit insert mode
|
j = { k = "normal_mode" } # Maps `jk` to exit insert mode
|
||||||
```
|
```
|
||||||
|
> NOTE: Typable commands can also be remapped, remember to keep the `:` prefix to indicate it's a typable command.
|
||||||
|
|
||||||
Control, Shift and Alt modifiers are encoded respectively with the prefixes
|
Control, Shift and Alt modifiers are encoded respectively with the prefixes
|
||||||
`C-`, `S-` and `A-`. Special keys are encoded as follows:
|
`C-`, `S-` and `A-`. Special keys are encoded as follows:
|
||||||
@ -53,4 +56,4 @@ # At most one section each of 'keys.normal', 'keys.insert' and 'keys.select'
|
|||||||
Keys can be disabled by binding them to the `no_op` command.
|
Keys can be disabled by binding them to the `no_op` command.
|
||||||
|
|
||||||
Commands can be found at [Keymap](https://docs.helix-editor.com/keymap.html) Commands.
|
Commands can be found at [Keymap](https://docs.helix-editor.com/keymap.html) Commands.
|
||||||
> Commands can also 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) at the invocation of `commands!` macro.
|
> Commands can also 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) at the invocation of `static_commands!` macro and the `TypableCommandList`.
|
||||||
|
Loading…
Reference in New Issue
Block a user