The Visual Incrementing script is one of the many awesome scripts created by Dr. Chip for Vim. What it does is simple: if you can mark a vertical visual block in Vim, it will replace that with a list of incrementing numbers.
For example, if you marked out a vertical visual block like this:
100 xyz xyz xyz xyz
Using this script, you can replace it with:
100 101 102 103 104
I use this most frequently along with ViDir to append incrementing numbers to a bunch of files from inside Vim. How awesome is that? 🙂
To use this script:
- It ships as a VimBall. To install it follow this post.
Identify the vertical block of text you want replaced by incremental list of numbers. Set the first text to the first number you want in the list.
Visually mark the vertical block of text using
To replace with incremental list of numbers enter the command:
:Iand press Enter.
To increment with different increments and other options, see the help of this script.
Tried with: Vim 7.4 and Ubuntu 14.04