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?
-
See vi.stackexchange.com/a/89/205– muruCommented Feb 2, 2017 at 6:40
-
2Maybe, maybe not. See the help center before responding further.– muruCommented Feb 2, 2017 at 7: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 TournoijCommented Feb 3, 2017 at 1:52
Add a comment
|
1 Answer
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.
-
-
@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: github.com/tpope/vim-scriptease/blob/master/plugin/… Here, you just have to prepend""
in front of thep
command, but still, it can be annoying to find where the fix is needed. Commented Feb 2, 2017 at 7:09