diff --git a/modules/basic/config.nix b/modules/basic/config.nix index a06cae2..3fdb45e 100644 --- a/modules/basic/config.nix +++ b/modules/basic/config.nix @@ -10,21 +10,51 @@ in { config = { vim.startPlugins = ["plenary-nvim"]; - vim.nmap = mkIf cfg.disableArrows { - "" = ""; - "" = ""; - "" = ""; - "" = ""; - }; + vim.maps.normal = + mkIf cfg.disableArrows { + "" = { + action = ""; - vim.imap = mkIf cfg.disableArrows { - "" = ""; - "" = ""; - "" = ""; - "" = ""; - }; + noremap = false; + }; + "" = { + action = ""; - vim.nnoremap = mkIf cfg.mapLeaderSpace {"" = "";}; + noremap = false; + }; + "" = { + action = ""; + noremap = false; + }; + "" = { + action = ""; + noremap = false; + }; + } + // mkIf cfg.mapLeaderSpace { + "" = { + action = ""; + }; + }; + + vim.maps.insert = mkIf cfg.disableArrows { + "" = { + action = ""; + noremap = false; + }; + "" = { + action = ""; + noremap = false; + }; + "" = { + action = ""; + noremap = false; + }; + "" = { + action = ""; + noremap = false; + }; + }; vim.configRC.basic = nvim.dag.entryAfter ["globalsScript"] '' " Debug mode settings diff --git a/modules/core/default.nix b/modules/core/default.nix index 78232b3..6e92cff 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -19,6 +19,107 @@ with builtins; let type = with types; attrsOf (nullOr str); } // it); + + mkBool = value: description: + mkOption { + type = types.bool; + default = value; + description = description; + }; + + # 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