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 {