Search code examples
vimcygwinvi

cygwin: line numbers in vi or vim have too much space in front, how is it removed?


Using the a recent or latest cygwin x86_64 version, Setup.exe version 2.871 (64 bit), when I use the vi or vim editor, and do a:

:set number

command, the line numbers appear, but are indented quite a few spaces, taking away from useful editing/screen space.

I use a larger editing window that fits the width of my screen, however this smaller one shows the problem, and I want more space on my larger windows as I use my main monitors in portrait mode, not landscape.

enter image description here

Is this easily fixed? Note the file is less than 500 lines (i.e. it's not like 100,000 lines "semi-justifying" the need for all that space.)


Solution

  • In vim, you can influence the width of the number column by the 'numberwidth' setting. You can't however have a smaller width, that the largest number would be wide (e.g. you can't set the width to 3 while you have more than 999 lines.)

    Read the details at :h 'numberwidth'