When I'm trying to increase numbers with CtrlA it removes the leading and the trailing zeros.For example:1.0095001.095001.0009500Results after pressing CtrlA:1.009500  ->  1.95011.09500   ->  1.95011.0009500 ->  1.9501or if cursor in front of the .1.009500  ->  2.0095001.09500   ->  2.095001.0009500 ->  2.0009500Is there a way to make it work like this:1.009500  ->  1.0095011.09500   ->  1.095011.0009500 ->  1.0009501I have tried this onvim --versionVIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 12 2015 04:35:19)
How can I increase floating number with ctrl-a without deleting zeros?
key bindings;vimrc
Thanks to @statox's suggestion, you can solve your issue with::set nrformats-=octalFirstly, Vim does not increment decimal number, it will try to increment 1 and 009500 separately. So the question is why incrementing 009500 removes the leading 0. As suggested by @sp asic, I think vim is treating this number as an octal number.Looking at the source code of Vim, a conversion between the string and the actual number is done, using the str2nr() function.You can see the definition of numbers in :h expr-number:                                            hex-number octal-numberDecimal, Hexadecimal (starting with 0x or 0X), or Octal (starting with 0).009500 is a number starting with a 0, but containing a 9, it's not an octal number, and should not have a leading 0.You can see the same result calling the str2nr() function yourself::echo str2nr(000100)64:echo str2nr(000900) 90000100 is a valid octal number, incrementing it will just add 1 to the result.00900 is an invalid decimal number, incrementing it will fix it (removing the leading 0) and incrementing it.Note: This is what I've understood of the little dig I've done in the Vim code, as I didn't understood everything I've read I may be wrong.I believe the code responsible for the decimal conversion is the following (source):while (VIM_ISDIGIT(*ptr)){    un = 10 * un + (uvarnumber_T)(*ptr - '0');    ++ptr;    if (n++ == maxlen)    break;}Considering the result is un, you can see that the first 0 won't add any value to the decimal number.