KellyPoima
New member
How do you copy multiple lines in vi?
Answer
Copy and paste multiple lines
With the cursor at your desired
line press nyy
, where n is the number of lines down you want to copy. So if you want to copy 2 lines, press 2yy . To paste press p and the number of lines copied will be pasted below the line you are on now.
Answer
Copy and paste multiple lines
With the cursor at your desired
line press nyy
, where n is the number of lines down you want to copy. So if you want to copy 2 lines, press 2yy . To paste press p and the number of lines copied will be pasted below the line you are on now.