diff --git a/modules/neovim/mappings/config.nix b/modules/neovim/mappings/config.nix index 28ebf081..365e1242 100644 --- a/modules/neovim/mappings/config.nix +++ b/modules/neovim/mappings/config.nix @@ -8,45 +8,26 @@ cfg = config.vim; in { config = { - vim.maps = { - normal = mkIf cfg.disableArrows { - "" = { - action = ""; - - noremap = false; - }; - "" = { - action = ""; - - noremap = false; - }; - "" = { - action = ""; - noremap = false; - }; - "" = { - action = ""; - noremap = false; - }; + vim.maps = mkIf cfg.disableArrows { + "" = { + mode = ["n" "i"]; + action = ""; + noremap = false; }; - - insert = mkIf cfg.disableArrows { - "" = { - action = ""; - noremap = false; - }; - "" = { - action = ""; - noremap = false; - }; - "" = { - action = ""; - noremap = false; - }; - "" = { - action = ""; - noremap = false; - }; + "" = { + mode = ["n" "i"]; + action = ""; + noremap = false; + }; + "" = { + mode = ["n" "i"]; + action = ""; + noremap = false; + }; + "" = { + mode = ["n" "i"]; + action = ""; + noremap = false; }; }; }; diff --git a/modules/neovim/mappings/options.nix b/modules/neovim/mappings/options.nix index 3b1f2634..c8cae278 100644 --- a/modules/neovim/mappings/options.nix +++ b/modules/neovim/mappings/options.nix @@ -1,96 +1,49 @@ {lib, ...}: let inherit (lib.options) mkOption; - inherit (lib.types) bool str attrsOf nullOr submodule; + inherit (lib.types) either str listOf attrsOf nullOr submodule; inherit (lib.nvim.config) mkBool; - # Most of the keybindings code is highly inspired by pta2002/nixvim. - # Thank you! - mapConfigOptions = { - silent = - mkBool false - "Whether this mapping should be silent. Equivalent to adding to a map."; - nowait = - mkBool false - "Whether to wait for extra input on ambiguous mappings. Equivalent to adding to a map."; - - script = - mkBool false - "Equivalent to adding