lib/keymaps: add abbreviation support to modes enum

See https://neovim.io/doc/user/usr_24.html#_abbreviations
This commit is contained in:
Matt Sturgeon 2025-02-15 13:51:37 +00:00
parent a1e168a2a0
commit d3a25cb97f
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
2 changed files with 8 additions and 0 deletions

View file

@ -427,9 +427,14 @@ You can provide several modes to a single mapping by using a list of strings.
| `"o"` | - | - | - | - | - | yes | - | - | Operator-pending mode |
| `"t"` | - | - | - | - | - | - | yes | - | Terminal mode |
| `"l"` | - | yes | yes | - | - | - | - | yes | Insert, command-line and lang-arg mode |
| `"!a"` | - | abr | abr | - | - | - | - | - | [Abbreviation] in insert and command-line mode |
| `"ia"` | - | abr | - | - | - | - | - | - | [Abbreviation] in insert mode |
| `"ca"` | - | - | abr | - | - | - | - | - | [Abbreviation] in command-line mode |
Each keymap can specify the following settings in the `options` attrs.
[Abbreviation]: https://neovim.io/doc/user/usr_24.html#_abbreviations
| NixVim | Default | VimScript |
|---------|---------|---------------------------------------------------|
| silent | false | `<silent>` |

View file

@ -37,6 +37,9 @@ rec {
"o" # operator-pending
"t" # terminal
"l" # insert, command-line and lang-arg
"!a" # abbreviation in insert and command-line
"ia" # abbreviation in insert
"ca" # abbreviation in command
];
modeEnum = lib.types.enum modes;