Visual Mode Increment

Alex R. Young
usevim
Published in
1 min readAug 2, 2015

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.

--

--