How do you add a string at the end of each line in vi?

Trần Vũ

New member
How do you add a string at the end of each line in vi?
Answer
To insert ” Hello world.” (space + clipboard) at the end of each of these lines:
  1. On a character in the first line, press Ctrl-V (or Ctrl-Q if Ctrl-V is paste).
  2. Press jj to extend the visual block over three lines.
  3. Press $ to extend the visual block to the end of each line. Press A then space then type Hello world.
 

Tìm kiếm

Back
Top