Sharing Vim Yank Register

4

1

Is it possible to run multiple instances of Vim which share their yank registers? I'd like to avoid having to yank to the system clipboard with "+y or opening my files in split windows within the same Vim instance.

Andrew Wood

Posted 2011-01-25T15:54:12.783

Reputation: 1 139

Answers

1

Have a look here: Using vim/gvim with multiple... Looks like it is on a todo list for the dev's

Dan M.

Posted 2011-01-25T15:54:12.783

Reputation: 1 676

5

In case the main thing you don't like about the "+y solution is the extra "+ typing, here's how to make the default y/d/p/c register (the so-called "unnamed" register "") system-global:

:set clipboard+=unnamed

When the "unnamed" string is included in the 'clipboard' option, the unnamed register is the same as the "* register. Thus you can yank to and paste the selection without prepending "* to commands.

source: last paragraph of :help clipboard

Aaron Thoma

Posted 2011-01-25T15:54:12.783

Reputation: 550

1

User gggg has posted a question that has received an answer which solves this problem via a shared text file and catching events via autocommands: Make vim yankings global via a shared text file

Aaron Thoma

Posted 2011-01-25T15:54:12.783

Reputation: 550

0

I made a plugin that does this.

https://github.com/ardagnir/united-front will have your vim instances automatically share most of their registers, including the default and yank registers. It works somewhat similarly to gggg's idea.

James

Posted 2011-01-25T15:54:12.783

Reputation: 11