So I am trying to see if there is a Vim command or algorithm to where I can sequentially copy numbers.
So essentially, if I have variables foo1 to foo10, is there a way to go from just:
foo1
to
foo1
foo1
foo1
foo1
foo1
foo1
foo1
foo1
foo1
foo1
foo1
to this:
foo1
foo2
foo3
foo4
foo5
foo6
foo7
foo8
foo9
foo10
or otherwise? Thank you.
Yes.
{Visual}g CTRL-A:However (tangential as it may be), while there is certainly a use case for this, "have variables
foo1tofoo10" is almost always a code smell. Most if not all programming languages have collection types like arrays/lists and dictionaries/hashes that address the need to have multiple grouped values.