OmniSharp / omnisharp-vim

Vim omnicompletion (intellisense) and more for C#
http://www.omnisharp.net
MIT License
1.72k stars 168 forks source link

Add plug mapping for new debug command #737

Closed jpfeiffer16 closed 3 years ago

jpfeiffer16 commented 3 years ago

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 nnoremaps yourself?

Thanks!

nickspoons commented 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

jpfeiffer16 commented 3 years ago

Thank you! That makes sense.