Assume I have a text file containing some strings:
string_g
string_r
string_qqwer
string_p
string_f
string_3qw
string_e
string_qw
And I need to insert increasing or decreasing numbers before the strings:
001 string_g
002 string_r
003 string_qqwer
004 string_p
005 string_f
006 string_3qw
007 string_e
008 string_qw
Just to avoid confusion:
I do not want line numbers to be displayed. I know how that works. What I want is an actual number at the beginning of each string within the text.
Is there a way to do this automatically with vim
?
I can mark the beginning of each string with CTRL-V then type : to enter the execute mode, which will allow me to execute command on the selection via :'<,'>
but I’m stuck there.