Often times it seems I have a list of items, and I need to add numbers in front of them. For example:
Item one
Item two
Item three
Which shoul
You can easily record a macro to do it.
First insert 1.
at the start of the first line (there are a couple of spaces after the 1.
but you can't see them).
Go to the start of the second line and go into record mode with qa
.
Press the following key sequence:
i # insert mode
# copy the first few characters from the line above
# back to normal mode
| # go back to the start of the line
# increment the number
j # down to the next line
q # stop recording
Now you can play back the recording with @a
(the first time; for subsequent times, you can do @@
to repeat the last-executed macro) and it will add a new incremented number to the start of each line.