How do I copy a range of lines in Vim?

Thanh Thảo

New member
How do I copy a range of lines in Vim?
Answer
The original lines will remain in the file.
  1. Open a terminal window to access a command prompt.
  2. Type the command “vim filename” to open the file that you want to edit. …
  3. Press the “Esc” key to enter command mode.
  4. Navigate to the first line in the series that you want to copy.
  5. Type “5yy” or “5Y” to copy five lines.
 

Tìm kiếm

Back
Top