Reputation: 10153
I didn't understand what <Plug>
does and how to use it. I read the documentation but it is not clear to me.
Upvotes: 2
Views: 456
Reputation: 172768
<Plug>
is just a special, synthetic key that is never actually sent by the keyboard; i.e. you cannot type it.
With this, the :map
functionality that comes from old vi can be used as an abstraction layer for plugins.
Instead of directly mapping plugin functionality to a fixed key, plugins define a <Plug>PluginNameFunctionName
mapping, which can then be freely remapped to the desired key by the user. As Vim allows to check for existing mappings (via hasmapto()
), plugins can also define a default mapping if none was specified by the user.
<Plug>
:map
your own left-hand side to the <Plug>
-mapping(s) provided by the plugin:help using-<Plug>
Upvotes: 8