From 29b9bd4db0c67a3b9d2bd4aa5ec6763d96997788 Mon Sep 17 00:00:00 2001 From: Frothy <76622149+FrothyMarrow@users.noreply.github.com> Date: Tue, 20 Feb 2024 22:15:18 -0500 Subject: [PATCH 1/5] utility/binds/which-key: allow configurable category labels --- modules/utility/binds/which-key/config.nix | 105 ++---------------- modules/utility/binds/which-key/which-key.nix | 15 ++- 2 files changed, 20 insertions(+), 100 deletions(-) diff --git a/modules/utility/binds/which-key/config.nix b/modules/utility/binds/which-key/config.nix index 6e2a83c..238d888 100644 --- a/modules/utility/binds/which-key/config.nix +++ b/modules/utility/binds/which-key/config.nix @@ -3,14 +3,17 @@ lib, ... }: let - inherit (lib) mkIf nvim; + inherit (lib.modules) mkIf; + inherit (lib.strings) optionalString; + inherit (lib.nvim.lua) toLuaObject; + inherit (lib.nvim.dag) entryAnywhere; cfg = config.vim.binds.whichKey; in { config = mkIf (cfg.enable) { vim.startPlugins = ["which-key"]; - vim.luaConfigRC.whichkey = nvim.dag.entryAnywhere '' + vim.luaConfigRC.whichkey = entryAnywhere '' local wk = require("which-key") wk.setup ({ key_labels = { @@ -20,108 +23,14 @@ in { [""] = "TAB", }, - ${lib.optionalString (config.vim.ui.borders.plugins.which-key.enable) '' + ${optionalString (config.vim.ui.borders.plugins.which-key.enable) '' window = { border = "${config.vim.ui.borders.plugins.which-key.style}", }, ''} }) - wk.register({ - ${ - if config.vim.tabline.nvimBufferline.enable - then '' - -- Buffer - ["b"] = { name = "+Buffer" }, - ["bm"] = { name = "BufferLineMove" }, - ["bs"] = { name = "BufferLineSort" }, - ["bsi"] = { name = "BufferLineSortById" }, - '' - else "" - } - - ${ - if config.vim.telescope.enable - then '' - ["f"] = { name = "+Telescope" }, - -- Telescope - ["fl"] = { name = "Telescope LSP" }, - ["fm"] = { name = "Cellular Automaton" }, -- TODO: mvoe this to its own parent group - ["fv"] = { name = "Telescope Git" }, - ["fvc"] = { name = "Commits" }, - '' - else "" - } - - ${ - if config.vim.lsp.trouble.enable - then '' - -- Trouble - ["lw"] = { name = "Workspace" }, - ["x"] = { name = "+Trouble" }, -- TODO: move all trouble binds to the same parent group - ["l"] = { name = "+Trouble" }, - '' - else "" - } - - ${ - if config.vim.lsp.nvimCodeActionMenu.enable - then '' - -- Parent Groups - ["c"] = { name = "+CodeAction" }, - '' - else "" - } - - ${ - if config.vim.minimap.codewindow.enable || config.vim.minimap.minimap-vim.enable - then '' - -- Minimap - ["m"] = { name = "+Minimap" }, -- TODO: remap both minimap plugins' keys to be the same - '' - else "" - } - - ${ - if config.vim.notes.mind-nvim.enable || config.vim.notes.obsidian.enable || config.vim.notes.orgmode.enable - then '' - -- Notes - ["o"] = { name = "+Notes" }, - -- TODO: options for other note taking plugins and their individual binds - -- TODO: move all note-taker binds under leader + o - '' - else "" - } - - ${ - # TODO: This probably will need to be reworked for custom-keybinds - if config.vim.filetree.nvimTree.enable - then '' - -- NvimTree - ["t"] = { name = "+NvimTree" }, - '' - else "" - } - - ${ - if config.vim.git.gitsigns.enable - then '' - -- Git - ["g"] = { name = "+Gitsigns" }, - '' - else "" - } - - ${ - if config.vim.utility.preview.glow.enable - then '' - -- Markdown - ["pm"] = { name = "+Preview Markdown" }, - '' - else "" - } - - }) + wk.register(${toLuaObject cfg.register}) ''; }; } diff --git a/modules/utility/binds/which-key/which-key.nix b/modules/utility/binds/which-key/which-key.nix index ceba7de..796dc8e 100644 --- a/modules/utility/binds/which-key/which-key.nix +++ b/modules/utility/binds/which-key/which-key.nix @@ -1,7 +1,18 @@ -{lib, ...}: let - inherit (lib) mkEnableOption; +{ + config, + lib, + ... +}: let + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.types) attrsOf str; in { options.vim.binds.whichKey = { enable = mkEnableOption "which-key keybind helper menu"; + + register = mkOption { + description = "Register label for which-key keybind helper menu"; + type = attrsOf str; + default = {}; + }; }; } From f19a5dd3ed5b288dc857c29b1de2028231e2f7f0 Mon Sep 17 00:00:00 2001 From: Frothy <76622149+FrothyMarrow@users.noreply.github.com> Date: Sun, 25 Feb 2024 11:40:43 -0500 Subject: [PATCH 2/5] lib: add function defaultAttributes --- lib/stdlib-extended.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/stdlib-extended.nix b/lib/stdlib-extended.nix index 9833248..943525b 100644 --- a/lib/stdlib-extended.nix +++ b/lib/stdlib-extended.nix @@ -68,6 +68,8 @@ in mkSetLuaBinding = binding: action: mkLuaBinding binding.value action binding.description; + defaultAttributes = attr: self.mapAttrs (name: value: self.mkDefault value) attr; + # For forward compatibility. literalExpression = super.literalExpression or super.literalExample; }) From b9aa7088b88a48bb9960ecb9803d46dca0386f2f Mon Sep 17 00:00:00 2001 From: Frothy <76622149+FrothyMarrow@users.noreply.github.com> Date: Sun, 25 Feb 2024 11:39:05 -0500 Subject: [PATCH 3/5] treewide: register whichKey labels --- modules/filetree/nvimtree/config.nix | 6 +++++- modules/git/config.nix | 6 +++++- modules/lsp/nvim-code-action-menu/config.nix | 6 +++++- modules/lsp/trouble/config.nix | 8 +++++++- modules/minimap/codewindow/config.nix | 6 +++++- modules/minimap/minimap-vim/config.nix | 6 +++++- modules/notes/mind-nvim/config.nix | 6 +++++- modules/notes/obsidian/config.nix | 6 +++++- modules/notes/orgmode/config.nix | 6 +++++- modules/tabline/nvim-bufferline/config.nix | 9 ++++++++- modules/utility/preview/glow/config.nix | 6 +++++- modules/utility/telescope/config.nix | 10 +++++++++- 12 files changed, 69 insertions(+), 12 deletions(-) diff --git a/modules/filetree/nvimtree/config.nix b/modules/filetree/nvimtree/config.nix index 5f11c5a..2c37c27 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; + inherit (lib) mkIf mkMerge mkBinding nvim boolToString defaultAttributes; cfg = config.vim.filetree.nvimTree; self = import ./nvimtree.nix { @@ -23,6 +23,10 @@ in { (mkBinding cfg.mappings.focus ":NvimTreeFocus" mappings.focus.description) ]; + vim.binds.whichKey.register = defaultAttributes { + "t" = "+NvimTree"; + }; + vim.luaConfigRC.nvimtreelua = nvim.dag.entryAnywhere '' ${ lib.optionalString (cfg.disableNetrw) '' diff --git a/modules/git/config.nix b/modules/git/config.nix index e0d4a03..6d76db3 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; + inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetExprBinding mkSetLuaBinding nvim defaultAttributes; cfg = config.vim.git; @@ -61,6 +61,10 @@ in { (mkSetLuaBinding gsMappings.resetHunk "function() package.loaded.gitsigns.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end") ]; + vim.binds.whichKey.register = defaultAttributes { + "g" = "+Gitsigns"; + }; + vim.luaConfigRC.gitsigns = nvim.dag.entryAnywhere '' require('gitsigns').setup{} ''; diff --git a/modules/lsp/nvim-code-action-menu/config.nix b/modules/lsp/nvim-code-action-menu/config.nix index c64f027..b667814 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; + inherit (lib) addDescriptionsToMappings mkIf mkSetBinding nvim defaultAttributes; cfg = config.vim.lsp; @@ -17,6 +17,10 @@ in { vim.maps.normal = mkSetBinding mappings.open ":CodeActionMenu"; + vim.binds.whichKey.register = defaultAttributes { + "c" = "+CodeAction"; + }; + vim.luaConfigRC.code-action-menu = nvim.dag.entryAnywhere '' -- border configuration vim.g.code_action_menu_window_border = '${config.vim.ui.borders.plugins.code-action-menu.style}' diff --git a/modules/lsp/trouble/config.nix b/modules/lsp/trouble/config.nix index ee136a5..5dd566c 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; + inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim defaultAttributes; cfg = config.vim.lsp; @@ -24,6 +24,12 @@ in { (mkSetBinding mappings.locList "TroubleToggle loclist") ]; + vim.binds.whichKey.register = defaultAttributes { + "l" = "Trouble"; + "x" = "+Trouble"; + "lw" = "Workspace"; + }; + vim.luaConfigRC.trouble = nvim.dag.entryAnywhere '' -- Enable trouble diagnostics viewer require("trouble").setup {} diff --git a/modules/minimap/codewindow/config.nix b/modules/minimap/codewindow/config.nix index 86b0137..fafd454 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; + inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetLuaBinding nvim defaultAttributes; cfg = config.vim.minimap.codewindow; @@ -24,6 +24,10 @@ in { (mkSetLuaBinding mappings.toggleFocus "require('codewindow').toggle_focus") ]; + vim.binds.whichKey.register = defaultAttributes { + "m" = "+Minimap"; + }; + vim.luaConfigRC.codewindow = nvim.dag.entryAnywhere '' local codewindow = require('codewindow') codewindow.setup({ diff --git a/modules/minimap/minimap-vim/config.nix b/modules/minimap/minimap-vim/config.nix index ef318f7..c9d738f 100644 --- a/modules/minimap/minimap-vim/config.nix +++ b/modules/minimap/minimap-vim/config.nix @@ -4,7 +4,7 @@ lib, ... }: let - inherit (lib) mkIf; + inherit (lib) mkIf defaultAttributes; cfg = config.vim.minimap.minimap-vim; in { @@ -13,5 +13,9 @@ in { pkgs.code-minimap "minimap-vim" ]; + + vim.binds.whichKey.register = defaultAttributes { + "m" = "+Minimap"; + }; }; } diff --git a/modules/notes/mind-nvim/config.nix b/modules/notes/mind-nvim/config.nix index 98f7751..c704d4b 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; + inherit (lib) mkIf nvim defaultAttributes; cfg = config.vim.notes.mind-nvim; in { @@ -18,6 +18,10 @@ in { "oc" = {action = ":MindClose";}; }; + vim.binds.whichKey.register = defaultAttributes { + "o" = "+Notes"; + }; + vim.luaConfigRC.mind-nvim = nvim.dag.entryAnywhere '' require'mind'.setup() ''; diff --git a/modules/notes/obsidian/config.nix b/modules/notes/obsidian/config.nix index 192244b..6cb0ef3 100644 --- a/modules/notes/obsidian/config.nix +++ b/modules/notes/obsidian/config.nix @@ -3,7 +3,7 @@ lib, ... }: let - inherit (lib) mkIf nvim; + inherit (lib) mkIf nvim defaultAttributes; cfg = config.vim.notes.obsidian; auto = config.vim.autocomplete; @@ -15,6 +15,10 @@ in { "tabular" ]; + vim.binds.whichKey.register = defaultAttributes { + "o" = "+Notes"; + }; + vim.luaConfigRC.obsidian = nvim.dag.entryAnywhere '' require("obsidian").setup({ dir = "${cfg.dir}", diff --git a/modules/notes/orgmode/config.nix b/modules/notes/orgmode/config.nix index 967a937..46201ef 100644 --- a/modules/notes/orgmode/config.nix +++ b/modules/notes/orgmode/config.nix @@ -3,7 +3,7 @@ lib, ... }: let - inherit (lib) mkIf mkMerge nvim; + inherit (lib) mkIf mkMerge nvim defaultAttributes; cfg = config.vim.notes.orgmode; in { @@ -13,6 +13,10 @@ in { "orgmode-nvim" ]; + vim.binds.whichKey.register = defaultAttributes { + "o" = "+Notes"; + }; + vim.luaConfigRC.orgmode = nvim.dag.entryAnywhere '' -- Load custom treesitter grammar for org filetype require('orgmode').setup_ts_grammar() diff --git a/modules/tabline/nvim-bufferline/config.nix b/modules/tabline/nvim-bufferline/config.nix index 9004c89..256875b 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; + inherit (lib) mkIf mkMerge mkLuaBinding mkBinding nvim defaultAttributes; cfg = config.vim.tabline.nvimBufferline; self = import ./nvim-bufferline.nix { @@ -40,6 +40,13 @@ in { (mkBinding cfg.mappings.movePrevious ":BufferLineMovePrev" mappings.movePrevious.description) ]; + vim.binds.whichKey.register = defaultAttributes { + "b" = "+Buffer"; + "bm" = "BufferLineMove"; + "bs" = "BufferLineSort"; + "bsi" = "BufferLineSortById"; + }; + vim.luaConfigRC.nvimBufferline = nvim.dag.entryAnywhere '' require("bufferline").setup{ options = { diff --git a/modules/utility/preview/glow/config.nix b/modules/utility/preview/glow/config.nix index 5b9e14f..130a1a5 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; + inherit (lib) nvim mkIf mkMerge mkBinding defaultAttributes; cfg = config.vim.utility.preview.glow; self = import ./glow.nix { @@ -19,6 +19,10 @@ in { (mkBinding cfg.mappings.openPreview ":Glow" mappings.openPreview.description) ]; + vim.binds.whichKey.register = defaultAttributes { + "pm" = "+Preview Markdown"; + }; + vim.luaConfigRC.glow = nvim.dag.entryAnywhere '' require('glow').setup({ glow_path = "${pkgs.glow}/bin/glow" diff --git a/modules/utility/telescope/config.nix b/modules/utility/telescope/config.nix index 53cde96..fa790bf 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; + inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim defaultAttributes; cfg = config.vim.telescope; self = import ./telescope.nix {inherit lib;}; @@ -52,6 +52,14 @@ in { ) ]; + vim.binds.whichKey.register = defaultAttributes { + "f" = "+Telescope"; + "fl" = "Telescope LSP"; + "fm" = "Cellular Automaton"; + "fv" = "Telescope Git"; + "fvc" = "Commits"; + }; + vim.luaConfigRC.telescope = nvim.dag.entryAnywhere '' local telescope = require('telescope') telescope.setup { From 9a7087e53cee73829d83dfc3e81eeea021b164f6 Mon Sep 17 00:00:00 2001 From: Frothy <76622149+FrothyMarrow@users.noreply.github.com> Date: Sun, 25 Feb 2024 11:49:43 -0500 Subject: [PATCH 4/5] docs: add entry for option `vim.binds.whichKey.register` --- docs/release-notes/rl-0.6.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/release-notes/rl-0.6.md b/docs/release-notes/rl-0.6.md index c162ac0..532f5d9 100644 --- a/docs/release-notes/rl-0.6.md +++ b/docs/release-notes/rl-0.6.md @@ -56,3 +56,5 @@ Release notes for release 0.6 - Rewrote the entire `fidget.nvim` module to include extensive configuration options. Option `vim.fidget-nvim.align.bottom` has been removed in favor of [vim.fidget-nvim.notification.window.align](vim.fidget-nvim.notification.window.align), which now supports `top` and `bottom` values. `vim.fidget-nvim.align.right` has no longer any equivalent and also has been removed. + +- `which-key.nvim` categories can now be customized through [vim.binds.whichKey.register](vim.binds.whichKey.register). From 4716fd731f67054c32e2a15f0b6a5ed8eb540056 Mon Sep 17 00:00:00 2001 From: Frothy <76622149+FrothyMarrow@users.noreply.github.com> Date: Sun, 25 Feb 2024 22:52:21 -0500 Subject: [PATCH 5/5] treewide: rename function `defaultAttributes` to `pushDownDefault` --- lib/stdlib-extended.nix | 2 +- modules/filetree/nvimtree/config.nix | 4 ++-- modules/git/config.nix | 4 ++-- modules/lsp/nvim-code-action-menu/config.nix | 4 ++-- modules/lsp/trouble/config.nix | 4 ++-- modules/minimap/codewindow/config.nix | 4 ++-- modules/minimap/minimap-vim/config.nix | 4 ++-- modules/notes/mind-nvim/config.nix | 4 ++-- modules/notes/obsidian/config.nix | 4 ++-- modules/notes/orgmode/config.nix | 4 ++-- modules/tabline/nvim-bufferline/config.nix | 4 ++-- modules/utility/preview/glow/config.nix | 4 ++-- modules/utility/telescope/config.nix | 4 ++-- 13 files changed, 25 insertions(+), 25 deletions(-) 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";