I'd use system-wide buffer. Which is "+" in vim
: "+yy
, then in other instance "+p
.
Edit: Explanation (kinda).
Double quotes followed by anything means "use named buffer instead of default one for the next copy or paste operation". "+
means use "+"
which is the system clipboard (and thanks to other answers here I now know about *
which is handy too).
yy
means "copy current line" - quite a lot of vim operations can be "doubled" like that to work on current line. dd
deletes a line, >>
indents a line etc.