mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
lib/keymaps: replace modes
attrs with list
Simplify and remove dead code. Replace the `desc` attrs with inline comments.
This commit is contained in:
parent
d542e373f1
commit
a1e168a2a0
1 changed files with 14 additions and 32 deletions
|
@ -25,39 +25,21 @@ rec {
|
||||||
buffer = defaultNullOpts.mkBool false "Make the mapping buffer-local. Equivalent to adding `<buffer>` to a map.";
|
buffer = defaultNullOpts.mkBool false "Make the mapping buffer-local. Equivalent to adding `<buffer>` to a map.";
|
||||||
};
|
};
|
||||||
|
|
||||||
modes = {
|
modes = [
|
||||||
normal.short = "n";
|
"" # normal, visual, select, and operator-pending (same as plain ':map')
|
||||||
insert.short = "i";
|
"n" # normal
|
||||||
visual = {
|
"!" # insert and command-line
|
||||||
desc = "visual and select";
|
"i" # insert
|
||||||
short = "v";
|
"c" # command
|
||||||
};
|
"v" # visual and select
|
||||||
visualOnly = {
|
"x" # visual only
|
||||||
desc = "visual only";
|
"s" # select
|
||||||
short = "x";
|
"o" # operator-pending
|
||||||
};
|
"t" # terminal
|
||||||
select.short = "s";
|
"l" # insert, command-line and lang-arg
|
||||||
terminal.short = "t";
|
];
|
||||||
normalVisualOp = {
|
|
||||||
desc = "normal, visual, select and operator-pending (same as plain 'map')";
|
|
||||||
short = "";
|
|
||||||
};
|
|
||||||
operator.short = "o";
|
|
||||||
lang = {
|
|
||||||
desc = "normal, visual, select and operator-pending (same as plain 'map')";
|
|
||||||
short = "l";
|
|
||||||
};
|
|
||||||
insertCommand = {
|
|
||||||
desc = "insert and command-line";
|
|
||||||
short = "!";
|
|
||||||
};
|
|
||||||
command.short = "c";
|
|
||||||
};
|
|
||||||
|
|
||||||
modeEnum =
|
modeEnum = lib.types.enum modes;
|
||||||
lib.types.enum
|
|
||||||
# ["" "n" "v" ...]
|
|
||||||
(map ({ short, ... }: short) (lib.attrValues modes));
|
|
||||||
|
|
||||||
mapOptionSubmodule = mkMapOptionSubmodule { };
|
mapOptionSubmodule = mkMapOptionSubmodule { };
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue