nest.nvim icon indicating copy to clipboard operation
nest.nvim copied to clipboard

Integration with `nvim-mapper`

Open bmulholland opened this issue 4 years ago • 3 comments

nvim-mapper provides a way to find and remember key mappings, but it requires re-writing your mappings in its special format. The special format provides no benefits except for informing the plugin about the available maps. On the other hand, nest.nvim provides a nice way of formatting mappings in ways that group similar keybindings together, a clear benefit that makes sense to adopt. An integration with nvim-mapper would make it much easier to get the benefits of both plugins with minimal changes to the nest.nvim format.

bmulholland avatar Aug 16 '21 10:08 bmulholland

I actually thought about the same thing, but with which-key, which also has a more complicated custom format to define mappings but is really good at showing mappings.

I will put it on the list for integrations - there might be several interesting optional integrations :-)

LionC avatar Aug 16 '21 11:08 LionC

Thanks for mentioning it! Actually I already use folke/which-key.nvim and thought it didn't work for non-leader keybindings. Now I see it does, so (I think?) I don't need to use nvim-mapper for those features.

I also see the which-key mapping format looks very similar to nest.vim - if you do add a which-key integration, it would be helpful to have some examples of why use nest.nvim's format :)

bmulholland avatar Aug 16 '21 11:08 bmulholland

I also see the which-key mapping format looks very similar to nest.vim - if you do add a which-key integration, it would be helpful to have some examples of why use nest.nvim's format :)

which-keys format actually tries to understand the keys, which means that grouping e.g. <C- does not work. As far as I know they also do not offer cascading options, just defaults, but I might be wrong about that. I tried to use it before to do what I did here and gave up at some point.

nest just concatenates strings for prefixes without any magic. That means that without parsing the binding myself, I do not really know the key sequence key-by-key (which which-key needs for the actual core feature of the plugin), but I also don't need to, because people can already read Vim mapping syntax.

LionC avatar Aug 16 '21 12:08 LionC