nvim-whichkey-setup.lua icon indicating copy to clipboard operation
nvim-whichkey-setup.lua copied to clipboard

question on local leader maps

Open klooj opened this issue 3 years ago • 9 comments

First of all, thank you. I've been wanting to corral my which-key lua hacks into a plugin but never got it together. I'm going to be implementing this tonight.

My question is, does this allow having individual local leader which-key popups that are unique to each filetype? so no more of this: image

klooj avatar Mar 29 '21 20:03 klooj

turns out my hacks were almost identical to this plugin. setup took 2 seconds and already so much better.

i have not figured out the buffer specific localleader popup guide though. local leader descriptions persist across buffers, unless they're changed to something else. I used wk.register_keymap('localleader', llmaps, {noremap = true, silent = true, bufnr = 0}). is this expected?

klooj avatar Mar 29 '21 21:03 klooj

Hi @klooj! Nice to hear that we found the same solutions :)

Hmm, that's strange. Indeed the intention is that that would setup keybindings only in the current buffer. I have to check what goes wrong. I'm away from my computer until Thursday so will check it then.

AckslD avatar Mar 30 '21 06:03 AckslD

No rush. It was so easy to setup that I haven't done a proper deep dive yet. I may figure it out before then.

klooj avatar Mar 30 '21 06:03 klooj

Cool, let me know if you do :)

AckslD avatar Mar 30 '21 07:03 AckslD

@klooj I now understand the issue, which is for the descriptions, i.e. not the keybindings themselves. Do you know how this is normally handled by whichkey actually?

AckslD avatar Apr 01 '21 13:04 AckslD

i'm not sure. whichkey did not handle this at all but then the last time i checked, like 6 months ago, a feature a branch was added to handle this specifically. so, i don't know the state of affairs right now.

klooj avatar Apr 02 '21 18:04 klooj

just so we're on the same page, I framed my initial post as a question because this functionality did not yet exist in the wild, as far i know.

klooj avatar Apr 03 '21 04:04 klooj

I love the nvim-whichkey-setup plugin but this issue is really quite annoying. Would love if it was fixed soon.

famiu avatar Apr 04 '21 12:04 famiu

@Famiu I definitely agree but this is not something we can really fix here but should be fixed in which-key itself. As mentioned by @klooj there is an open PR for this but not yet merged. Hopefully this will get merged soon. Whenever that happens I'll make sure to do any updates needed here.

AckslD avatar Apr 04 '21 18:04 AckslD