mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +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.";
|
||||
};
|
||||
|
||||
modes = {
|
||||
normal.short = "n";
|
||||
insert.short = "i";
|
||||
visual = {
|
||||
desc = "visual and select";
|
||||
short = "v";
|
||||
};
|
||||
visualOnly = {
|
||||
desc = "visual only";
|
||||
short = "x";
|
||||
};
|
||||
select.short = "s";
|
||||
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";
|
||||
};
|
||||
modes = [
|
||||
"" # normal, visual, select, and operator-pending (same as plain ':map')
|
||||
"n" # normal
|
||||
"!" # insert and command-line
|
||||
"i" # insert
|
||||
"c" # command
|
||||
"v" # visual and select
|
||||
"x" # visual only
|
||||
"s" # select
|
||||
"o" # operator-pending
|
||||
"t" # terminal
|
||||
"l" # insert, command-line and lang-arg
|
||||
];
|
||||
|
||||
modeEnum =
|
||||
lib.types.enum
|
||||
# ["" "n" "v" ...]
|
||||
(map ({ short, ... }: short) (lib.attrValues modes));
|
||||
modeEnum = lib.types.enum modes;
|
||||
|
||||
mapOptionSubmodule = mkMapOptionSubmodule { };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue