Closed jpfeiffer16 closed 3 years ago
Thanks!
They're not strictly necessary, they just give an easy way to remap. Not just used in external plugins either, if you search the Vim source, there are many usages of it in built-in plugins too: https://github.com/vim/vim/search?q=%3Cplug%3E
In our case most of our <Plug>
mappings simply call a command directly so they're not that important and users could just as well make their own mapping to the command. But it's nice to have them for consistency and discoverability.
One other thing I do like about <Plug>
mappings though is that, when a plugin does create default user mappings, there's an easy way for users to disable specific mappings, by e.g. nmap <F99> <Plug>(omnisharp_go_to_definition)
, as long as the plugin checks for the <Plug>
mapping. I have done this in vim-sharpenup here.
It's also summarised pretty well by r/-romainl- in this reddit thread
Thank you! That makes sense.
Hi again!
So I forgot to add plug a mapping for the new command. I think we need this right?
Also, this is somewhat sad, but I don't really get what those are for. They seem to be a new thing that a lot of projects are using. What is their advantage over doing your own
nnoremap
s yourself?Thanks!