Wednesday, December 14, 2011

Copy and paste content from one file to another file in VI

Here are steps:

  1. Open the file you need to edit
  2. :sp /path/to/the/file/... and open the file that you need to copy from (this will split the window and open the other file in top section)
  3. Locate the lines you want to copy. If it 10 lines type 10yy
  4. Move to the other file using CTRL+ws
  5. Figure out where you need to paste the yanked lines type p
That's it :)


No comments:

Post a Comment

Day 03 Gala Dinner Highlight Video