If I decrement my octal number so that it wraps around Vim adds length to this number.
Can the length added be configured?
00 Decrement with Ctrl-X gives


Even if I have a octal byte
000000000 it gets lengthened to 01777777777777777777777
event though I think it should still be the same byte length after wrapping.

Eg. 01777777

1 Answer 1



(only for decimal, not for octal)

You can simply add unsigned to your nrformat:

:set nrformats+=unsigned

See :help nrformats for more info


Because your Vim uses 64bit.

The highest values you can store in 64-bit:

In decimal it is 2^64 - 1 or:


If you convert this now to octal, it's this:


And for binary:


Hope that helps :)

  • Thanks for the answer. Is there any way to prevent this from happening? I would class this as a bug as it changes the length of the number being edited in a non-predictable way. Commented Jan 26, 2023 at 12:33
  • 1
    @GustavBlomqvist Okay I have updated my answer and found a solution. That at least works for decimal :)
    – Bog
    Commented Jan 26, 2023 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.