Sometimes I need to insert some similar lines in a file which differ only in a sequence number. For example,
print "func 1";
print "func 2";
print "func 3";
print "func 4";
print "func 5";
Using vim, I end up copy pasting the first line using [yypppp] and then changing the last four lines. This is really slow if you have more lines to insert.
Is there a faster way to do this in vim?
An example of this is:
Initial state
boot();
format();
parse();
compare();
results();
clean();
Final state
print "func 1";
format();
print "func 2";
parse();
print "func 3";
compare();
print "func 4";
results();
print "func 5";
clean();
/[0-9]\+
, VIM Automagically moves the cursor to the number – Oxyhydrogen