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.

link|improve this question

feedback

4 Answers

up vote 1 down vote accepted

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

link|improve this answer
feedback

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

link|improve this answer
feedback

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: Rewriting vim's yank?

link|improve this answer
feedback

I don't think this is what the OP wanted to know. I believe what we are talking about / wanting is the case where:

  • one set of files open in one instance of vim in my WM.
  • another set of files open in a different WM window
  • the ability to yank to a buffer and then pull across multiple windows.

Vim's windowing doesn't work well for this because when you :bn you invariably end up in one of the files you don't want to see in that window, and again it's windowing outside your window manager which doesn't make any sense.

I would think if you could actually "yank" to some dotfile in your home directory and then have the "pull" get the line out. I could see each line of the file actually being prefixed with a named buffer so like <"qyy> would make a line in the file like "q>this is my line of text;" so you could have named buffers. AND if you wanted to get crazy, you could name these files different things so you could have various helpers for your language of choice at the ready always.

Having written that I would be surprised if someone hasn't figured this out already?

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.