You might also want to check out the increment package here. If you have a block of text,
test
test
test
test
test
test
test
test
test
test
test
You can select the 't' on the first line, and enter visual block mode using Ctrl-V
. Select until the last line, then enter insert mode with I
. Enter the number '1' plus a space, and hit escape to leave visual block mode. You'll then have a 1 before each line:
1 test
1 test
1 test
1 test
1 test
1 test
1 test
1 test
1 test
1 test
1 test
Next, highlight all of the 1's in visual block mode again, and type :Inc<CR>
. This will increment the numbers, essentially numbering your lines in text:
1 test
2 test
3 test
4 test
5 test
6 test
7 test
8 test
9 test
10 test
11 test