Wunderbread
Wunderbread

Reputation: 1070

How can I copy/paste text from one Vim file to another Vim file in another shell tab?

I understand copy/paste within Vim, but how can I copy/paste from one file open in Vim within one shell tab into another shell tab containing another open file?

A similar problem would be copying from a remote machine using Vim to a local machine.

Additional context: I am using a Raspberry Pi running Raspbian GNU/Linux 10

Upvotes: 2

Views: 1385

Answers (1)

Christian Gibbons
Christian Gibbons

Reputation: 4370

If you are running in an X Window environment and you have clipboard support built into Vim, you can use the + register to yank and paste to/from the system clipboard.

For example, to yank a full line: "+yy and then to paste: "+p

For remote machines, I believe you would need to ssh in to the remote machine with X11 forwarding.

Upvotes: 4

Related Questions