I love the relative line numbering feature in Vim 7.3, but am having trouble making it stick universally. For many files, line numbering reverts to absolute mode, even though I have specified:
set rnu
in my .vimrc
file. Any idea what could be causing this? I am using Vim 7.3 on OSX 10.6, with the Janus package of extensions.
To show line numbers in Vim, use the :set number command for absolute line numbers, :set relativenumber for relative line numbers. If both absolute and relative line numbers are enabled Vim switches to the hybrid line numbering mode.
The relative line numbers setting allows you to jump exactly where you want without having to do a mental addition or subtraction. The strategy is to look at the line number column, jump to the line you want to edit using a command like 10k, jump to the part of the line you want to change, and perform the edit.
We can the use plugin vim-numbertoggle to automatically toggle relative number based on several events.
Try using :verbose set rnu?
and :verbose set nu?
to find the script that is causing the problem.
Add this to your .vimrc.after
:
set nonumber
set relativenumber
Relative line numbers should persist with these settings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With