0

I sometimes have multiple xterm windows open and run vim in both of them. Is there any way to copy text from one window to the other using registers if I don't have '+clipboard' enabled?

Steps to reproduce:

  1. Open a new xterm, run vim -u NONE -N (vim with unsourced .vimrc to make sure that no plugin interferes)
  2. Yank a word with yiw, yank another word with "ayiw
  3. Run :reg to check how the registers "0 and "a look like.
  4. Open a new xterm and start vim again with vim -u NONE -N. I am now unable to paste either of the two words yanked before. Running :reg show that indeed the registers "0 and "a look different than the ones in my first xterm window.

I understand that would I have vim with '+clipboard' enabled, I could use the "+ register. But what can I do if I don't want have this option and don't want to open my two buffers in the same vim instance, but instead in two different xterms?

  • Or use something like this: github.com/ardagnir/united-front – VanLaser Aug 23 '15 at 11:08
  • This sounds weird: you want the effect of X-integration without actual X-integration. Can't you simply install a proper Vim? – romainl Aug 23 '15 at 11:20
  • No: you need both +clipboard and +xterm_clipboard, and only the contents of the clipboard is shared, via the system clipboard. Other registers are not shared. – Sato Katsura Aug 23 '15 at 11:33
  • @romainl: Not the X-integration was the key point of my question, but rather register sharing across different vim sessions as I want to work with multiple registers not only with "+. Register sharing across vim sessions works with Christian Brabandt's answer or VanLasers comment. – cbaumhardt Aug 23 '15 at 12:25
1

Registers are not shared between different Vim sessions. If you want that, then you have to store and load the data from a file. I think, the Yankring plugin does something like this.

Also it should be possible to write your viminfo using :wv file after you put something into your desired register and load it from the other vim session using :rv. See also the faq

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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