Last Updated: February 25, 2016
·
407
· kalashnikovisme

Numbering lines in vim

Use for numbering lines this regexp:

:%s/^/\=line(".").". "

You've had:

First item
Second item
Third item

Now, you have:

1. First item
2. Second item
3. Third item

Responsible for numbers format is characters quotes ". " (dot and space).