Wednesday, December 3, 2014

Copy all the lines from a file using vim to another

First open the file using 'vim'.

e.g. vim testfile.txt

Then to copy use "ggVGy" or ":%y a", now the content is in the clipboard.

Open a new terminal and open a new file with 'vim' where you are going to paste it.

Then use "p" or "P" to put the content in the file from the clipboard.

No comments:

Post a Comment