vim - set relativenumber not working from vimrc, only works when set in buffer

5

1

For the life of me, I cannot figure out why set relativenumber does not load when set in my .vimrc file. Other settings, like set number and setting the color scheme work perfectly. If I want set relativenumber, I need to set it in the current buffer explicitly. Any ideas? My .vimrc file can be found here:

https://github.com/mhamrah/vimfiles/blob/master/.vimrc

Thanks.

mhamrah

Posted 2011-01-31T00:07:05.560

Reputation: 153

Answers

13

It's because you have :set number later in your .vimrc -- number and relativenumber are incompatible with one another. Take out that line.

frabjous

Posted 2011-01-31T00:07:05.560

Reputation: 9 044

1Note, this is no longer true, as of version 7.3.787. Recent versions of Vim allow you to set both options at the same time; in that case the current line number will show an absolute value, every other line will show relative values. – Ben – 2015-09-21T14:48:27.503

Thanks, it worked! I had no idea they were mutually exclusive. I thought number turned on numbering while relativenumber made it relative. – mhamrah – 2011-01-31T01:06:46.790