From d3a25cb97f8e8c4b77949b1e9fcf26b7ded42fbc Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Sat, 15 Feb 2025 13:51:37 +0000 Subject: [PATCH] lib/keymaps: add abbreviation support to `modes` enum See https://neovim.io/doc/user/usr_24.html#_abbreviations --- README.md | 5 +++++ lib/keymap-helpers.nix | 3 +++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index edc5955502..85fe08c27d 100644 --- a/README.md +++ b/README.md @@ -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 | `` | diff --git a/lib/keymap-helpers.nix b/lib/keymap-helpers.nix index 77efc0b3a2..87a1529338 100644 --- a/lib/keymap-helpers.nix +++ b/lib/keymap-helpers.nix @@ -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;