diff --git a/lib/stdlib-extended.nix b/lib/stdlib-extended.nix index 943525b..ff7b7f6 100644 --- a/lib/stdlib-extended.nix +++ b/lib/stdlib-extended.nix @@ -68,7 +68,7 @@ in mkSetLuaBinding = binding: action: mkLuaBinding binding.value action binding.description; - defaultAttributes = attr: self.mapAttrs (name: value: self.mkDefault value) attr; + pushDownDefault = attr: self.mapAttrs (name: value: self.mkDefault value) attr; # For forward compatibility. literalExpression = super.literalExpression or super.literalExample; diff --git a/modules/filetree/nvimtree/config.nix b/modules/filetree/nvimtree/config.nix index 2c37c27..9da8afd 100644 --- a/modules/filetree/nvimtree/config.nix +++ b/modules/filetree/nvimtree/config.nix @@ -4,7 +4,7 @@ pkgs, ... }: let - inherit (lib) mkIf mkMerge mkBinding nvim boolToString defaultAttributes; + inherit (lib) mkIf mkMerge mkBinding nvim boolToString pushDownDefault; cfg = config.vim.filetree.nvimTree; self = import ./nvimtree.nix { @@ -23,7 +23,7 @@ in { (mkBinding cfg.mappings.focus ":NvimTreeFocus" mappings.focus.description) ]; - vim.binds.whichKey.register = defaultAttributes { + vim.binds.whichKey.register = pushDownDefault { "t" = "+NvimTree"; }; diff --git a/modules/git/config.nix b/modules/git/config.nix index 6d76db3..39366d9 100644 --- a/modules/git/config.nix +++ b/modules/git/config.nix @@ -4,7 +4,7 @@ ... }: let inherit (builtins) toJSON; - inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetExprBinding mkSetLuaBinding nvim defaultAttributes; + inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetExprBinding mkSetLuaBinding nvim pushDownDefault; cfg = config.vim.git; @@ -61,7 +61,7 @@ in { (mkSetLuaBinding gsMappings.resetHunk "function() package.loaded.gitsigns.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end") ]; - vim.binds.whichKey.register = defaultAttributes { + vim.binds.whichKey.register = pushDownDefault { "g" = "+Gitsigns"; }; diff --git a/modules/lsp/nvim-code-action-menu/config.nix b/modules/lsp/nvim-code-action-menu/config.nix index b667814..9f8f604 100644 --- a/modules/lsp/nvim-code-action-menu/config.nix +++ b/modules/lsp/nvim-code-action-menu/config.nix @@ -3,7 +3,7 @@ lib, ... }: let - inherit (lib) addDescriptionsToMappings mkIf mkSetBinding nvim defaultAttributes; + inherit (lib) addDescriptionsToMappings mkIf mkSetBinding nvim pushDownDefault; cfg = config.vim.lsp; @@ -17,7 +17,7 @@ in { vim.maps.normal = mkSetBinding mappings.open ":CodeActionMenu"; - vim.binds.whichKey.register = defaultAttributes { + vim.binds.whichKey.register = pushDownDefault { "c" = "+CodeAction"; }; diff --git a/modules/lsp/trouble/config.nix b/modules/lsp/trouble/config.nix index 5dd566c..bb751c7 100644 --- a/modules/lsp/trouble/config.nix +++ b/modules/lsp/trouble/config.nix @@ -3,7 +3,7 @@ lib, ... }: let - inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim defaultAttributes; + inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim pushDownDefault; cfg = config.vim.lsp; @@ -24,7 +24,7 @@ in { (mkSetBinding mappings.locList "TroubleToggle loclist") ]; - vim.binds.whichKey.register = defaultAttributes { + vim.binds.whichKey.register = pushDownDefault { "l" = "Trouble"; "x" = "+Trouble"; "lw" = "Workspace"; diff --git a/modules/minimap/codewindow/config.nix b/modules/minimap/codewindow/config.nix index fafd454..b95aca8 100644 --- a/modules/minimap/codewindow/config.nix +++ b/modules/minimap/codewindow/config.nix @@ -3,7 +3,7 @@ lib, ... }: let - inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetLuaBinding nvim defaultAttributes; + inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetLuaBinding nvim pushDownDefault; cfg = config.vim.minimap.codewindow; @@ -24,7 +24,7 @@ in { (mkSetLuaBinding mappings.toggleFocus "require('codewindow').toggle_focus") ]; - vim.binds.whichKey.register = defaultAttributes { + vim.binds.whichKey.register = pushDownDefault { "m" = "+Minimap"; }; diff --git a/modules/minimap/minimap-vim/config.nix b/modules/minimap/minimap-vim/config.nix index c9d738f..6577e8c 100644 --- a/modules/minimap/minimap-vim/config.nix +++ b/modules/minimap/minimap-vim/config.nix @@ -4,7 +4,7 @@ lib, ... }: let - inherit (lib) mkIf defaultAttributes; + inherit (lib) mkIf pushDownDefault; cfg = config.vim.minimap.minimap-vim; in { @@ -14,7 +14,7 @@ in { "minimap-vim" ]; - vim.binds.whichKey.register = defaultAttributes { + vim.binds.whichKey.register = pushDownDefault { "m" = "+Minimap"; }; }; diff --git a/modules/notes/mind-nvim/config.nix b/modules/notes/mind-nvim/config.nix index c704d4b..8a609b0 100644 --- a/modules/notes/mind-nvim/config.nix +++ b/modules/notes/mind-nvim/config.nix @@ -3,7 +3,7 @@ lib, ... }: let - inherit (lib) mkIf nvim defaultAttributes; + inherit (lib) mkIf nvim pushDownDefault; cfg = config.vim.notes.mind-nvim; in { @@ -18,7 +18,7 @@ in { "oc" = {action = ":MindClose";}; }; - vim.binds.whichKey.register = defaultAttributes { + vim.binds.whichKey.register = pushDownDefault { "o" = "+Notes"; }; diff --git a/modules/notes/obsidian/config.nix b/modules/notes/obsidian/config.nix index 6cb0ef3..f521c62 100644 --- a/modules/notes/obsidian/config.nix +++ b/modules/notes/obsidian/config.nix @@ -3,7 +3,7 @@ lib, ... }: let - inherit (lib) mkIf nvim defaultAttributes; + inherit (lib) mkIf nvim pushDownDefault; cfg = config.vim.notes.obsidian; auto = config.vim.autocomplete; @@ -15,7 +15,7 @@ in { "tabular" ]; - vim.binds.whichKey.register = defaultAttributes { + vim.binds.whichKey.register = pushDownDefault { "o" = "+Notes"; }; diff --git a/modules/notes/orgmode/config.nix b/modules/notes/orgmode/config.nix index 46201ef..08df2de 100644 --- a/modules/notes/orgmode/config.nix +++ b/modules/notes/orgmode/config.nix @@ -3,7 +3,7 @@ lib, ... }: let - inherit (lib) mkIf mkMerge nvim defaultAttributes; + inherit (lib) mkIf mkMerge nvim pushDownDefault; cfg = config.vim.notes.orgmode; in { @@ -13,7 +13,7 @@ in { "orgmode-nvim" ]; - vim.binds.whichKey.register = defaultAttributes { + vim.binds.whichKey.register = pushDownDefault { "o" = "+Notes"; }; diff --git a/modules/tabline/nvim-bufferline/config.nix b/modules/tabline/nvim-bufferline/config.nix index 256875b..befafcd 100644 --- a/modules/tabline/nvim-bufferline/config.nix +++ b/modules/tabline/nvim-bufferline/config.nix @@ -3,7 +3,7 @@ lib, ... }: let - inherit (lib) mkIf mkMerge mkLuaBinding mkBinding nvim defaultAttributes; + inherit (lib) mkIf mkMerge mkLuaBinding mkBinding nvim pushDownDefault; cfg = config.vim.tabline.nvimBufferline; self = import ./nvim-bufferline.nix { @@ -40,7 +40,7 @@ in { (mkBinding cfg.mappings.movePrevious ":BufferLineMovePrev" mappings.movePrevious.description) ]; - vim.binds.whichKey.register = defaultAttributes { + vim.binds.whichKey.register = pushDownDefault { "b" = "+Buffer"; "bm" = "BufferLineMove"; "bs" = "BufferLineSort"; diff --git a/modules/utility/preview/glow/config.nix b/modules/utility/preview/glow/config.nix index 130a1a5..aca57f0 100644 --- a/modules/utility/preview/glow/config.nix +++ b/modules/utility/preview/glow/config.nix @@ -4,7 +4,7 @@ lib, ... }: let - inherit (lib) nvim mkIf mkMerge mkBinding defaultAttributes; + inherit (lib) nvim mkIf mkMerge mkBinding pushDownDefault; cfg = config.vim.utility.preview.glow; self = import ./glow.nix { @@ -19,7 +19,7 @@ in { (mkBinding cfg.mappings.openPreview ":Glow" mappings.openPreview.description) ]; - vim.binds.whichKey.register = defaultAttributes { + vim.binds.whichKey.register = pushDownDefault { "pm" = "+Preview Markdown"; }; diff --git a/modules/utility/telescope/config.nix b/modules/utility/telescope/config.nix index fa790bf..eb7a14e 100644 --- a/modules/utility/telescope/config.nix +++ b/modules/utility/telescope/config.nix @@ -4,7 +4,7 @@ lib, ... }: let - inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim defaultAttributes; + inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim pushDownDefault; cfg = config.vim.telescope; self = import ./telescope.nix {inherit lib;}; @@ -52,7 +52,7 @@ in { ) ]; - vim.binds.whichKey.register = defaultAttributes { + vim.binds.whichKey.register = pushDownDefault { "f" = "+Telescope"; "fl" = "Telescope LSP"; "fm" = "Cellular Automaton";