You could do this by
- recording a macro, then
- using the
global
ex command to execute the macro n number of times for each line in the file.
After recording the macro, undo the changes done while recording, or there will be 13n + 1 additional lines for the first line, and twelven for consecutive lines.
Record the macro to the a
register with
qayyp$?\d<CR><C-A>q
This records into register a
(qa...q
) the following command:
yyp
: duplicate the current line$
: move to end of line?\d<CR>
: search backwards for a single digit<C-A>
: increment digit under the cursor by one
When the macro is recorded, remove the changes made while recording it either by undoing (uu
) or by deleting the current line (dd
). Then repeat the macro 1211
(or any number of) times for each line in the file with the global command:
:g//normal 12@a11@a