How can I insert text at the end of a group of lines?

2017-03-21 19:07:50

Let's say I had a block of text...

Lorem ipsum

Lorem ipsum dolor

Lorem ipsum dolor sit

Lorem ipsum dolor sit amet

...and I wanted to insert a . at the end of each line. What would the best approach be to achieve this?

First you can visually select them using V and then use the movement keys to select the entire text (or if the text were strictly a paragraph you could do [starting at the first line] V}). And then type :. This should bring up something like :'<,'> in the command-line.

:'<'>normal A.

This executes normal A. on the selected lines. normal A. executes A. as normal mode keystrokes. This Appends a . at the end of each of the selected lines.

  • First you can visually select them using V and then use the movement keys to select the entire text (or if the text were strictly a paragraph you could do [starting at the first line] V}). And then type :. This should bring up something like :'<,'> in the command-line.

    :'<'>normal A.

    This executes normal A. on the selected lines. normal A. executes A. as normal mode keystrokes. This Appends a . at the end of each of the selected lines.

    2017-03-21 19:48:14