Vim always has 3 spaces for the line numbers on the left, in the gutter. Since I set relativenumber, and (unfortunately) don't have a monitor with the vertical space for 100 lines, I will never need more than 2 places for the line number. The leftmost column is always an extra space.

How can I reclaim that valuable screen real estate?

1 Answer 1


Vim automatically sets the gutter spacing, but it has some constraints. Notably, numberwidth determines the minimum number of columns reserved for the gutter. The default is 4, 3 for the numbers and 1 for the space separating the numbers from the text. That's one too many in this case, so set numberwidth=3 in your vimrc, and you should be good to go.

Additionally, if you want 80 columns of text in your gvim windows, set columns=83 will give you 2 line numbers, 1 space, and 80 columns.

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.