If you're on linux, you could filter the text through the external command nl
to 'number the lines of files' with the --number-width=1 argument to ensure
no leading whitespace:
Using the% sign means do the command for 'all lines in the buffer'. But you
could also do 20,30!nl -w1 to ...
No mapping necessary!
Vim has the & command which just repeats the last substitution. The same way as . repeats the last command, I can move to the next true and simply hit & which will apply again the last substitution. Neat and simple.
I found out by googling “vi repeat last substitution”
which yielded this SO post as the first result.