您的位置:首页 > Web前端

What is difference between Vim's clipboard “unnamed” and “unnamedplus” settings?

2016-05-27 08:36 471 查看
http://stackoverflow.com/questions/30691466/what-is-difference-between-vims-clipboard-unnamed-and-unnamedplus-settings

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?

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 (Ctrl+C and Ctrl+V 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:

Ctrl+C in other programs and put in Vim with p on all three platforms,

yank in Vim with y and Ctrl+V 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)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  vim