Replies: 1 comment
-
I don't understand why you need them predefined... maybe, just define maps only when you need them(?): vim.api.nvim_create_autocmd({...},{
-- extension pattern is an obvious take her, but there might be other options
pattern = '*',
callback = function()
-- here you call, for example,
require 'which-key'.register(maps, opts)
end,
}) You can also do a similar thing to UNregister them. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to set pretty labels for plugin commands that are only available under certain conditions, like a filetype or a mode, but whenever I register just the label, it shows up regardless of whether it actually does anything. Example with nvim-orgmode:


this shows up like this:
"Insert" here (i.e. not inside a .org file) doesn't do anything, and in fact would trigger an error if I pressed it.
Beta Was this translation helpful? Give feedback.
All reactions