Our great sponsors
-
which-key.nvim
💥 Create key bindings that stick. WhichKey is a lua plugin for Neovim 0.5 that displays a popup with possible keybindings of the command you started typing.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I am new to neovim customisation (I have come from doom-emacs) and I have been trying to set up keybinds with which-key.nvim.
This is fine, but what is the canonical way to retrieve buffer numbers? For example NvimTree always seems to be buffer 2 (in my extremely limited testing), so specifying buffer=2 in opts works fine. I originally tried something like: lua opts = {..., buffer = vim.fn.bufnr("NvimTree"),...} however this didn't work. I would also like to rename many functions as they appear in the which-key popup. For example, vim-fugitive exposes a command g? when in the git status interface; in the which-key interface this appears like help fugitive-map... or something uninformative. This can be renamed using which-key, but it will then expose a g? command in which-key in all buffers, unless I specify a buffer number. I guess the problem here might be that g? probably just calls :help fugitive-map which is a global command, despite the command g? that invokes this being local to the fugitive buffer...?