Skip to content

Commit

Permalink
lib/keymaps: add abbreviation support to modes enum
Browse files Browse the repository at this point in the history
  • Loading branch information
MattSturgeon committed Feb 15, 2025
1 parent a1e168a commit d3a25cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>` |
Expand Down
3 changes: 3 additions & 0 deletions lib/keymap-helpers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d3a25cb

Please sign in to comment.