diff --git a/modules/utility/binds/which-key.nix b/modules/utility/binds/which-key.nix deleted file mode 100644 index ce65134..0000000 --- a/modules/utility/binds/which-key.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ - pkgs, - config, - lib, - ... -}: -with lib; -with builtins; let - cfg = config.vim.binds.whichKey; -in { - options.vim.binds.whichKey = { - enable = mkEnableOption "which-key menu"; - }; - - config = mkIf (cfg.enable) { - vim.startPlugins = ["which-key"]; - - vim.luaConfigRC.whichkey = nvim.dag.entryAnywhere '' - require("which-key").setup {} - - local wk = require("which-key") - wk.register({ - ["b"] = { name = "+Buffer" }, - ["c"] = { name = "+CodeAction" }, - ["b"] = { name = "+Buffer" }, - ["f"] = { name = "+Telescope" }, - ["m"] = { name = "+Minimap" }, - ["o"] = { name = "+Notes" }, - ["t"] = { name = "+NvimTree" }, - ["x"] = { name = "+Trouble" }, -- TODO: move all trouble binds to the same parent group - ["l"] = { name = "+Trouble" }, - - -- Buffer - ["bm"] = { name = "BufferLineMove" }, - ["bm"] = { name = "BufferLineSort" }, - - -- Telescope - ["fl"] = { name = "Telescope LSP" }, - ["fm"] = { name = "Cellular Automaton" }, -- TODO: mvoe this to its own parent group - ["fv"] = { name = "Telescope Git" }, - ["fvc"] = { name = "Commits" }, - - -- Trouble - ["lw"] = { name = "Workspace" }, - }) - - ''; - }; -} diff --git a/modules/utility/binds/cheatsheet.nix b/modules/utility/utility/cheatsheet/default.nix similarity index 100% rename from modules/utility/binds/cheatsheet.nix rename to modules/utility/utility/cheatsheet/default.nix diff --git a/modules/utility/binds/default.nix b/modules/utility/utility/default.nix similarity index 59% rename from modules/utility/binds/default.nix rename to modules/utility/utility/default.nix index 9dd64ac..7c08cc6 100644 --- a/modules/utility/binds/default.nix +++ b/modules/utility/utility/default.nix @@ -5,7 +5,7 @@ ... }: { imports = [ - ./which-key.nix - ./cheatsheet.nix + ./which-key + ./cheatsheet ]; } diff --git a/modules/utility/utility/which-key/default.nix b/modules/utility/utility/which-key/default.nix new file mode 100644 index 0000000..66b3f3f --- /dev/null +++ b/modules/utility/utility/which-key/default.nix @@ -0,0 +1,109 @@ +{ + pkgs, + config, + lib, + ... +}: +with lib; +with builtins; let + cfg = config.vim.binds.whichKey; +in { + options.vim.binds.whichKey = { + enable = mkEnableOption "which-key menu"; + }; + + config = mkIf (cfg.enable) { + vim.startPlugins = ["which-key"]; + + vim.luaConfigRC.whichkey = nvim.dag.entryAnywhere '' + require("which-key").setup {} + + local wk = require("which-key") + wk.register({ + + ${ + if config.vim.tabline.nvimBufferline.enable + then '' + -- Buffer + ["b"] = { name = "+Buffer" }, + ["bm"] = { name = "BufferLineMove" }, + '' + 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" }, + '' + 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 "" + } + + ${ + if config.vim.filetree.nvimTreeLua.enable + then '' + -- NvimTree + ["t"] = { name = "+NvimTree" }, + '' + else "" + } + + ${ + if config.vim.git.gitsigns.enable + then '' + -- Git + ["g"] = { name = "+Gitsigns" }, + '' + else "" + } + + }) + + ''; + }; +}