Reputation: 24344
What is the difference between these 2 settings?
set clipboard=unnamed
set clipboard=unnamedplus
Which one should I use in order to have multi-platform .vimrc?
Upvotes: 107
Views: 50250
Reputation: 196789
On Mac OS X and Windows, the *
and +
registers both point to the system clipboard so unnamed
and unnamedplus
have the same effect: the unnamed register is synchronized with the system clipboard.
On Linux, you have essentially two clipboards: one is pretty much the same as in the other OSes (CtrlC and CtrlV in other programs, mapped to register +
in Vim), the other is the "selection" clipboard (mapped to register *
in Vim).
Using only unnamedplus
on Linux, Windows and Mac OS X allows you to:
p
on all three platforms,y
and CtrlV in other programs on all three platforms.If you also want to use Linux's "selection" clipboard, you will also need unnamed
.
Here is a cross-platform value:
set clipboard^=unnamed,unnamedplus
Reference:
:h 'clipboard'
(and follow the tags)
Upvotes: 160