For example, when I yank some text from vim, then :wq
, and open a new file. When I try to paste the text I just yanked, it doesn't work. So how to yank text between files?
use "+y
to send the yanked text to the clipboard, and "+p
to paste it into the new file.
So if I have a file named A that contains abcdef
and I (in visual mode) select def
and then press "+y
while in normal mode. I have just copied def
to the system clipboard. Now I can open up a file named B and (while in normal mode) press "+p
the text def
will be pasted into file B.
Don't quit the editor after writing with :wq
Instead, just write the file with :w
and then edit the new file with :e file
. Or Edit both at the same time by splitting with :sp file
and ^W
to switch between the screens.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With