Vim tip: more intuitive CTRL-A (adding) and CTRL-X (subtracting)
Little disclaimer. What’s “more intuitive” for me may not be “more intuitive” for you. Also, the title says “Vim” but everything here is applicable in Neovim. With that out of the way, let’s learn something cool!
Vim allows us to increment a number via CTRL-A and decrement it using CTRL-X. Super handy, and I use it all the time. Look 👀
If you pay attention, you will see that on the second line, the CTRL-A instead of adding to a month digit, subtracts from it. This tripped me up so many times!
In the string 2026-03-10, when you try to bump up a month, you are actually adding a number to -03. Adding 1 to -03 is -02, so what Vim is doing is correct, but this is not the way I would like to use this feature. The nrformats option is made precisely to control this behaviour.
This defines what bases Vim will consider for numbers when using the CTRL-A and CTRL-X commands for adding to and subtracting from a number respectively.
vim.o.nrformats = "unsigned"
-- or
vim.o.nrformats = "blank"
Smash that into your config and from now on Vim will treat all numbers as absolute values. Now it works like I want!