When using set number and set numberwidth I'd like to have the line numbers padded with zeros instead of spaces.
example:
0001
0002
0003
Can it be done?
When using set number and set numberwidth I'd like to have the line numbers padded with zeros instead of spaces.
example:
0001
0002
0003
Can it be done?
AFAIK, this can only be done by changing the Vim source code and rebuilding.
The changes you need to make are as follows:
For zero-padded number, in src/screen.c on lines 2502 and 3712, replace:
char *fmt = "%*ld ";
with
char *fmt = "%0*ld ";
For zero-padded relativenumber, in the same file, on lines 2519 and 3725, replace:
fmt = "%-*ld ";
with
fmt = "%0*ld ";
Line numbers noted above are for the current version on Github, 7.4.1799.
y key. The URL in your browser will change accordingly.
– Jair López
May 01 '16 at 15:49