diff --git a/docs/configuration/keymap.md b/docs/configuration/keymap.md index d6ee07a9..7d5c14bb 100644 --- a/docs/configuration/keymap.md +++ b/docs/configuration/keymap.md @@ -77,6 +77,55 @@ keymap = [ ] ``` +## Key notation {#notation} + +You can specify one or more keys in the `on` of each keybinding rule, and each key can be represented with the following notations: + +| Notation | Description | +| ---------------- | ------------------ | +| `a` - `z` | Lowercase letters. | +| `A` - `Z` | Uppercase letters. | +| `` | Space key. | +| `` | Backspace key. | +| `` | Enter key. | +| `` | Left arrow key. | +| `` | Right arrow key. | +| `` | Up arrow key. | +| `` | Down arrow key. | +| `` | Home key. | +| `` | End key. | +| `` | PageUp key. | +| `` | PageDown key. | +| `` | Tab key. | +| `` | Shift + Tab key. | +| `` | Delete key. | +| `` | Insert key. | +| `` - `` | Function keys. | +| `` | Escape key. | + +You can combine the following modifiers for the keys above: + +| Modifier | Description | +| -------- | -------------------------- | +| `` | Shift key. | +| `` | Ctrl key. | +| `` | Alt/Meta key. | +| `` | Command/Windows/Super key. | + +For example: + +- `` for Ctrl + a. +- `` or `` for Ctrl + Shift + b. + +Note that: + +1. Not all terminals support `` - make sure your terminal supports and has [CSI u][CSI u] enabled if you want to use it. +2. macOS doesn't have an Alt key, so `` won't work. Some terminals offer a setting to map the Option as the Alt key, make sure you have it enabled. +3. The [legacy terminal keyboard protocol][Control character] treats `` and ``, `` and ``, etc. as the same key. If you want to distinguish between them, make sure your terminal supports and has [CSI u][CSI u] enabled. + +[CSI u]: https://sw.kovidgoyal.net/kitty/keyboard-protocol/ +[Control character]: https://en.wikipedia.org/wiki/Control_character + ## [manager] {#manager} ### `escape` {#manager.escape}