{ 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 "" } }) ''; }; }