![](/_resources/VIMul2ol.png)
VIM add numbers to range
To number a section, press V to select the first line, then press j to extend the selection down until all required lines are selected. Then type the following command (do not type '<,'> as that is inserted by Vim):
:'<,'>s/^/\=printf("%d.\t", line(".") - line("'<") + 1)
To change an unordered list (in Markdown) to an ordered list, select the items in the unordered list, then execute:
:'<,'>s/^- /\=printf("%d.\t", line(".") - line("'<") + 1)