diff --git a/README.md b/README.md index 7755e57c..ed0dd62b 100644 --- a/README.md +++ b/README.md @@ -321,18 +321,23 @@ If you are using `makeNixvimWithModule`, then options is treated as options for ## Key mappings It is fully possible to define key mappings from within NixVim. This is done -using the `maps` attribute: +using the `keymaps` attribute: ```nix { programs.nixvim = { - maps = { - normalVisualOp.";" = ":"; - normal."m" = { - silent = true; - action = "make"; + keymaps = [ + { + key = ";"; + action = ":"; + } + { + mode = "n"; + key = "m"; + options.silent = true; + action = "!make"; }; - }; + ]; }; } ``` @@ -344,34 +349,35 @@ noremap ; : nnoremap m make ``` -This table describes all modes for the `maps` option: +This table describes all modes for the `keymaps` option. +You can provide several mode to a single mapping by using a list of strings. -| NixVim | NeoVim | -|----------------|--------------------------------------------------| -| normal | Normal mode | -| insert | Insert mode | -| visual | Visual and Select mode | -| select | Select mode | -| terminal | Terminal mode | -| normalVisualOp | Normal, visual, select and operator-pending mode | -| visualOnly | Visual mode only, without select | -| operator | Operator-pending mode | -| insertCommand | Insert and command-line mode | -| lang | Insert, command-line and lang-arg mode | -| command | Command-line mode | +| Short | Description | +|-------|--------------------------------------------------| +| `"n"` | Normal mode | +| `"i"` | Insert mode | +| `"v"` | Visual and Select mode | +| `"s"` | Select mode | +| `"t"` | Terminal mode | +| `"" ` | Normal, visual, select and operator-pending mode | +| `"x"` | Visual mode only, without select | +| `"o"` | Operator-pending mode | +| `"!"` | Insert and command-line mode | +| `"l"` | Insert, command-line and lang-arg mode | +| `"c"` | Command-line mode | -The map options can be set to either a string, containing just the action, -or to a set describing additional options: +Each keymap can specify the following settings in the `options` attrs. -| NixVim | Default | VimScript | -|---------|---------|------------------------------------------| -| silent | false | `` | -| nowait | false | `` | -| script | false | `