diff --git a/extra.nix b/extra.nix index b5231fb..e767e1e 100644 --- a/extra.nix +++ b/extra.nix @@ -163,7 +163,7 @@ inputs: let vim.comments = { comment-nvim.enable = true; - kommentary = builtins.trace "WARNING: kommentary is deprecated and will be removed in the future, use comment-nvim instead" {enable = true;}; + kommentary = builtins.trace "WARNING: kommentary is deprecated and will be removed in the future, use comment-nvim instead" {enable = false;}; }; }; }; diff --git a/modules/utility/binds/cheatsheet.nix b/modules/utility/binds/cheatsheet/default.nix similarity index 100% rename from modules/utility/binds/cheatsheet.nix rename to modules/utility/binds/cheatsheet/default.nix diff --git a/modules/utility/binds/default.nix b/modules/utility/binds/default.nix index 9dd64ac..7c08cc6 100644 --- a/modules/utility/binds/default.nix +++ b/modules/utility/binds/default.nix @@ -5,7 +5,7 @@ ... }: { imports = [ - ./which-key.nix - ./cheatsheet.nix + ./which-key + ./cheatsheet ]; } diff --git a/modules/utility/binds/which-key.nix b/modules/utility/binds/which-key.nix deleted file mode 100644 index ef9fdf6..0000000 --- a/modules/utility/binds/which-key.nix +++ /dev/null @@ -1,20 +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 ''local wk = require("which-key").setup {}''; - }; -} diff --git a/modules/utility/binds/which-key/default.nix b/modules/utility/binds/which-key/default.nix new file mode 100644 index 0000000..bd06bf3 --- /dev/null +++ b/modules/utility/binds/which-key/default.nix @@ -0,0 +1,112 @@ +{ + 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" }, + ["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" }, + '' + 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 "" + } + + }) + + ''; + }; +}