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