Skip to content

Commit d3a25cb

Browse files
committed
lib/keymaps: add abbreviation support to modes enum
See https://neovim.io/doc/user/usr_24.html#_abbreviations
1 parent a1e168a commit d3a25cb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,14 @@ You can provide several modes to a single mapping by using a list of strings.
427427
| `"o"` | - | - | - | - | - | yes | - | - | Operator-pending mode |
428428
| `"t"` | - | - | - | - | - | - | yes | - | Terminal mode |
429429
| `"l"` | - | yes | yes | - | - | - | - | yes | Insert, command-line and lang-arg mode |
430+
| `"!a"` | - | abr | abr | - | - | - | - | - | [Abbreviation] in insert and command-line mode |
431+
| `"ia"` | - | abr | - | - | - | - | - | - | [Abbreviation] in insert mode |
432+
| `"ca"` | - | - | abr | - | - | - | - | - | [Abbreviation] in command-line mode |
430433

431434
Each keymap can specify the following settings in the `options` attrs.
432435

436+
[Abbreviation]: https://neovim.io/doc/user/usr_24.html#_abbreviations
437+
433438
| NixVim | Default | VimScript |
434439
|---------|---------|---------------------------------------------------|
435440
| silent | false | `<silent>` |

lib/keymap-helpers.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ rec {
3737
"o" # operator-pending
3838
"t" # terminal
3939
"l" # insert, command-line and lang-arg
40+
"!a" # abbreviation in insert and command-line
41+
"ia" # abbreviation in insert
42+
"ca" # abbreviation in command
4043
];
4144

4245
modeEnum = lib.types.enum modes;

0 commit comments

Comments
 (0)