How can I merge OS clipboard and Vim's one? I want them to be the same, so that I don't have to use "*y or "*p or "*d, instead just y, or p or d. How can I do that?
Asked
Active
Viewed 602 times
1
Torito
- 119
- 2
-
See http://vi.stackexchange.com/a/89/205 – muru Feb 02 '17 at 06:40
-
2Maybe, maybe not. See the [help/behavior] before responding further. – muru Feb 02 '17 at 07:07
-
Note that the linked question should contain the answer: "If you want to "automatically" interface with the system's clipboard instead of referring to it manually all the time, you can set the clipboard variable: [...]" – Martin Tournoij Feb 03 '17 at 01:52
1 Answers
2
From :h 'cb:
*clipboard-unnamed*
unnamed When included, Vim will use the clipboard register '*'
for all yank, delete, change and put operations which
would normally go to the unnamed register. When a
register is explicitly specified, it will always be
used regardless of whether "unnamed" is in 'clipboard'
or not. The clipboard register can always be
explicitly accessed using the "* notation. Also see
|gui-clipboard|.
So, maybe you could try to prepend the value 'unnamed' to the option 'clipboard':
set clipboard^=unnamed
As the help explains, this should tell Vim to use the * register for all yank, delete, change and put operations.
muru
- 24,838
- 8
- 82
- 143
user9433424
- 6,138
- 2
- 21
- 30
-
-
@Torito I said maybe because I'm not using exactly this setting. I'm using this :
set clipboard^=unnamedplus. It should work, but it can lead to problems if you're using plugins. Often, plugin authors forget to take into consideration that the user may change their'clipboard'option. Because of this, sometimes a functionality they provide doesn't work as expected. Here is an example: https://github.com/tpope/vim-scriptease/blob/master/plugin/scriptease.vim#L251 Here, you just have to prepend""in front of thepcommand, but still, it can be annoying to find where the fix is needed. – user9433424 Feb 02 '17 at 07:09