How to copy text in one screen window running vim and paste it to another without traditional copy and paste

copy/pastedisplayvim

I'd like to essentially yank text y'k and mk or yy in one instance of vim in one screen tab and paste it into another instance of vim in a different screen tab without having to select the text with my mouse and ctrl+c/ctrl+v.

How can I do that?

Best Answer

You can either use the register * (middle mouse paste) or + (“normal” clipboard):

"*y
"+y

Edit:

To make it more clear, the commands I wrote above assume that you marked some text visually. To copy the current line you can for example do: V"*y and then you can paste in every application with the middle mouse button. Or you can use V"+y and paste with ctrl-v or whatever shortcut you have configured to paste.

Related Question