cntrl + a and
cntrl + x in vim normal mode, you can increment or decrement any integer with wrapping.
For example, if you had
9 somewhere in your text file, pressing
cntrl + a with your cursor over 9 in normal mode
But wait, there’s more.
Vim repetitions allow for any integer to be added to any number by running
cntrl + a n times.
For example, typing
15 cntrl + a will add 15 to any currently highlighted integer. This is very useful.
But wait, there’s even more.
Vim supports binary and hexidecimal integers with the
Using vim reptitions, you can automatically add any integer value to any binary or hexidecimal value
without having to do any manual conversions. For example,
14 cntrl + a on
0xf will produce
How cool is that? Your favorite text editor is also a binary calculator.