Thursday, March 24, 2011

copy/paste from one file to another file in vim

if you open one file using: $vim file1, and open another file using: $vim file2
there is no way to copy the content from file1 to file2

but you could open two files by using on vim app, then you could do copy/paste

vim file1 file2
mark with ctrl+v and hit y to yank.
:n or :next to switch to the next file
p to paste
:prev and :previous will switch to the previous file.
you can also use :first and :last

No comments: