-sinbad
You have my vote too.
The single absolute number isn't useful to me as I have a statusline
with that information. What's bothering me though is that it's an
aesthetic irregularity, an irritation that distracts from the sidelines.
To my eyes it _looks_ like a bug!
I'd very much prefer the old tidy line of right-aligned numbers.
> If nobody wants yet another option, maybe a configuration option?
I have an idea.
'nonumber' 'number' 'nonumber' 'number'
'nornu' 'nornu' 'rnu' 'rnu'
|apple | 1 apple | 2 apple | 2 apple
|pear | 2 pear | 1 pear | 1 pear
|nobod[y] | 3 nobod[y] | 0 nobod[y] |3 nobod[y]
|there | 4 there | 1 there | 1 there
Thus,
- ":set nonu nornu" means: I don't want any line numbers;
- ":set nu nornu" means: I want to see only absolute numbers;
- ":set nonu rnu" means: I want to see only relative numbers;
- ":set nu rnu" means: I want to have the best of both worlds.
If you want to be generic, it would be better to use
set columnfunctions=myfun1,myfun2,myfun3
. All functions should return a 2-tuple (hl group, text). This way you don't need to choose whether you want a error marker or a change marker from the plugin described earlier. This suggestion is mainly a replacement for signs, but it is just as good for numbers.
> Marc Weber
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
I don't know, I think this looks like a decent idea.
It doesn't add ANOTHER configuration option, and while the play between the two might be somewhat complex, it can't be much worse than it currently is.
This should be the best way to go about it.
Jorge
Maybe, but this was specifically added as a feature so I doubt it will get
reverted.
I certainly prefer the line number instead of zero.
>
> my personal opinion would be to have the default for rnu0 to be on, but
> we should vote on that, with Bram as the decider since most people won't
> care or vote
>
In the vim_dev thread Christian mentioned (
https://groups.google.com/group/vim_dev/msg/194c62c57ddf9ee9 ) Bram
already said explicitly that he didn't want another option for this.
>
> (when I first expressed enthusiasm for relative numbers they showed the
> zero, not some misaligned line number that's repeated in the ruler -- it
> looks suspiciously like something that was snuck in my someone just
> showing off (looky what I can do!))
>
It wasn't. It was a "the zero is useless; let's display some useful
information there instead" argument with lots of discussion.
Not everybody shows the line number in their status line or ruler, or
shows either of those things at all, and they may want to be able to see a
line number still. Or in my case, I may have so many open windows that the
line number in the status line is much harder to pick out than if I just
scan over to the left on my current line. Or maybe the statusline setting
is such that line numbers get truncated on narrow windows. Additionally,
when Vim doesn't have input focus (for referring to line numbers in an
email or something), you can't even ":set number" easily to see line
numbers in your window. My solution to this is a FocusLost autocmd but
that pre-dated the line number at the cursor line in relativenumber mode.
Perhaps I would have just used that (and mentally added or subtracted the
line number) were it available before I made my FocusGained/FocusLost
autocmds.
There are plenty of use cases where an absolute line number in the
relative column is very useful, and currently the only complaint is "it
makes my number column a few characters wider and I don't like that".
How about a different solution? We could modify the behavior of that
absolute number, to make it so that one absolute numbered line isn't
allowed to expand the line number column. If it won't fit, show zero or
truncate it with < like in the statusline or something. If a user wants to
show it anyway they can increase their 'numberwidth' option.
I was going to see what happens to the normal line number column when the
limit of width 10 is reached, but Vim has been chugging away for almost an
hour trying to load a 3GB file (I let a cmd.exe "for" loop run for a while
to create a huge file with nothing but DOS-style line endings); even with
no plugins, eventignore set to "all", undolevels set to -1, and using the
:view command to avoid a swap file. So I think I'll give up on waiting for
that.
No, it's useful feedback, but there are constraints on the solution:
1. Don't remove support for the line number in place of zero entirely
2. No new options specifically to control this feature
Personally I thought Bram pulled the trigger on than absolute line number thing before consensus was reached on how it should work. But patches speak louder than words either way.
I like the proposal by "glts" myself:
> - ":set nonu nornu" means: I don't want any line numbers;
> - ":set nu nornu" means: I want to see only absolute numbers;
> - ":set nonu rnu" means: I want to see only relative numbers;
> - ":set nu rnu" means: I want to have the best of both worlds.
Christian, what is the problem you have with this approach?
Stepping away from the relative number issue for a second (hopefully it will move to and not die in the vim_dev list), I wrote my own version of showmarks that is way simpler (does less stuff) and doesn't have the lag that showmarks does. At the moment I restrict attention to the lower-case letter marks, which are the only ones I care about. I've attached it.
It's real nice to have your marks show up in the signs column.