Visual Mode Increment

In Vim patch 7.4.754, I noticed Vim now supports incrementing numbers in Visual mode. You can increment numbers by pressing CTRL-A, and decrement with CTRL-X. It's one of those features that doesn't sound amazingly useful but can be handy once you've memorised it. If you build off Vim's master branch you can try it out now.

Visual increment

To enter Visual mode, type CTRL-V (technically Visual mode blockwise). You can then use hjkl to select multiple lines, and increment the numbers on each line with CTRL-A. I thought this might be good for shifting sets of numbers in a numerical list, like you might find in a Markdown file for example.

Like what you read? Give Alex R. Young a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.