Every time someone shows me something they like about some other editor it is always fun to show how the same thing can be done in vim. A popular thing in modern editors now seems to be multiple cursors and folks get excited about appending some text to a bunch of lines all at the same time.
Suppose you have a bunch of lines that you want to turn into an unordered list in HTML. Here is a quick and easy way to add something to the end of a line in vim.
- Select the lines you want to work with
- norm (type the following commands)
- A</li> (the string you want to append to the lines)
If you visually select the lines you want to work with, the full command might look something like this.
:'<,'>norm A
And that will take your from code that looks like this:
- line one
- line two
- line three
To code that looks like this:
- line one
- line two
- line three