I think '0' adds no value but an absolute number for the current line only would be useful. I keep rnu set and rarely set nu.
In the meantime, I'd suggest creating a mapping to toggle between rnu, nu, and nornu nonu.
I only rarely edit files with 10000 or more lines. Most of the time for me, my 'rnu' column takes 4 columns, and my 'nu' column takes 5. I don't care about the extra width, and would probably never turn off the option to show the absolute number on the current line if there were such an option. I'd support doing it that way always, but I'd accept an option as well.
> Thank you -- I'll try it out (but I'm having troubles getting gtk
> enabled for vim for some odd reason, and am working on that)
Just in case you haven't, you've tried yum-builddep? (I mucked about for a while before discovering apt-get build-dep, and judging by how often I posted about it here so did others.)
Regards, John Little
That would be a huge backwards incompatibility. I haven't followed the patches themselves closely, so maybe this is done already, but why can't setting 'number' and 'relativenumber' just have the effect of manipulating the 'linenumber' option (and vice versa)?
For example:
:set number
:set relativenumber
:set linenumber=number
:set number? relativenumber? linenumber?
number norelativenumber linenumber=number
:set number
:set linenumber=number
:set relativenumber
:set number? relativenumber? linenumber?
nonumber relativenumber linenumber=relative
I just thought that it will have a huge psychological effect. Right now the brain is adjusted to the way numbers go from 0. Seeing some arbitrary number right near your code is not the best thing. Bram says it's annoying for people when we mess with existing settings, isn't this one of them? A lot of people who use relative number at the moment are used to check the current line number in the status bar. Moving this to another place breaks people habits. Yes, they will still be able to use status bar for that, but they get some distractive information.
See also the thread on vim_use with an alternate approach:
https://groups.google.com/d/topic/vim_use/fjG8gaeqpRc/discussion
IIUC the patch by Christian in that thread uses 'number' plus 'relativenumber' together to mean the same as 'currentnumber' set to 1 (or maybe -1), and 'relativenumber' by itself to mean 0.
Is there any movement with this patch? What are Bram's thoughts on it?
I'm finding that the relativenumber changes are breaking the an old and fairly well-known method toggling relative and absolute numbers as configured here: http://www.vimbits.com/bits/192 . While I like this feature, I do agree having an option to default to the "old" behavior is best moving forward.
Thanks,
Stan
Bram's thoughts were that he doesn't want any new option for this.
But patch 7.3.1115 changes the 'number' and 'relativenumber' options so that instead of resetting each other, they interact with each other, so that 4 different displays can be achieved:
both set: relative numbers + absolute number in current line
relativenumber only: only relative numbers, 0 in current line
number only: only absolute numbers
neither set: no line numbering
> I'm finding that the relativenumber changes are breaking the an old and fairly well-known method toggling relative and absolute numbers as configured here: http://www.vimbits.com/bits/192 .
Then fix it. It can no longer rely on the old behavior where one option resets the other, since the options were modified to interact with each other instead.
If you like the absolute number in the current line, then you don't need to touch 'number' at all, just toggle relativenumber on and off.
If you do NOT like the absolute number in the current line, you need to do "set number norelativenumber" and "set nonumber relativenumber" instead of just setting one option or the other.
I do indeed like this new behavior better though :)
Thanks very much for your help!
--Stan