mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-23 09:18:38 +02:00
plugins/misc: adapt to new maps options
This commit is contained in:
parent
574fb73258
commit
dd6a114e52
18 changed files with 262 additions and 193 deletions
|
@ -264,27 +264,24 @@ in {
|
|||
require("todo-comments").setup${helpers.toLuaObject setupOptions}
|
||||
'';
|
||||
|
||||
maps.normal = let
|
||||
silent = cfg.keymapsSilent;
|
||||
inherit (cfg) keymaps;
|
||||
in
|
||||
mkMerge (
|
||||
keymaps =
|
||||
flatten
|
||||
(
|
||||
mapAttrsToList
|
||||
(
|
||||
optionName: funcName: let
|
||||
keymap = keymaps.${optionName};
|
||||
|
||||
inherit (keymap) key;
|
||||
keymap = cfg.keymaps.${optionName};
|
||||
|
||||
cwd = optionalString (keymap.cwd != null) " cwd=${keymap.cwd}";
|
||||
keywords = optionalString (keymap.keywords != null) " keywords=${keymap.keywords}";
|
||||
|
||||
action = ":${funcName}${cwd}${keywords}<CR>";
|
||||
in
|
||||
mkIf (keymap != null) {
|
||||
${key} = {
|
||||
inherit silent action;
|
||||
};
|
||||
optional
|
||||
(keymap != null)
|
||||
{
|
||||
mode = "n";
|
||||
inherit (keymap) key;
|
||||
action = ":${funcName}${cwd}${keywords}<CR>";
|
||||
options.silent = cfg.keymapsSilent;
|
||||
}
|
||||
)
|
||||
commands
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue