{ config, lib, ... }: with lib; with builtins; let cfg = config.vim.binds.whichKey; in { config = mkIf (cfg.enable) { vim.startPlugins = ["which-key"]; vim.luaConfigRC.whichkey = nvim.dag.entryAnywhere '' local wk = require("which-key") wk.setup ({ key_labels = { [""] = "SPACE", [""] = "SPACE", [""] = "RETURN", [""] = "TAB", } }) 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.nvimTreeLua.enable then '' -- NvimTree ["t"] = { name = "+NvimTree" }, '' else "" } ${ if config.vim.git.gitsigns.enable then '' -- Git ["g"] = { name = "+Gitsigns" }, '' else "" } ${ if config.vim.markdown.glow.enable then '' -- Markdown ["pm"] = { name = "+Preview Markdown" }, '' else "" } }) ''; }; }