Better line numbers for Vim
myusuf3.github.io
Better line numbers for Vim
1–10 of 46 posts
Re: Better line numbers for Vim
#2Hats off to you, sir!
Re: Better line numbers for Vim
#3Re: Better line numbers for Vim
#4TERM=screen-256color-s cleared it up for me using tmux/urxvt (with 256 colors).
(Also, great plugin!)
Re: Better line numbers for Vim
#5That said, VIM patch 7.3.787 provides a 'better' solution by replacing the current line's number with the absolute number (because seeing 0 on the current line provides nothing meaningful) IMHO:
with 'relativenumber' can't see the absolute line number
ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.787Re: Better line numbers for Vim
#6This is kinda life-changing. You have now made the use of numeric count prefixes to line-wise operations actually useful. 20dd for example. Delete groups of lines quickly and with precision, without guessing how many lines are involved.
Re: Better line numbers for Vim
#7Here's something a little more complicated, which may or may not be more useful:
http://jeffkreeftmeijer.com/2012/relative-line-numbers-in-vi...
Re: Better line numbers for Vim
#8Here's what it looked like: http://i.imgur.com/NTwwB.jpg
Here was the patch. I wrote it back in 2011: https://code.google.com/r/justinvh-vim/source/detail?r=c2479...
Ultimately Bram Moolenaar sent me a reply:
"""
Justin,
I think the audience for this would be too small.
- Bram
"""
However, in 7.3.787 (Jan 2013) a patch was introduced which showed the current line number in :rnu instead of 0. That's definitely in the direction that this patch was going in.
So, I didn't get a patch in, but on the plus side, I did learn a bunch about vim's source code.
Re: Better line numbers for Vim
#9This is kinda life-changing. You have now made the use of numeric count prefixes to line-wise operations actually useful. 20dd for example. Delete groups of lines quickly and with precision, without guessing how many lines are involved.
I didn't even realize relative numbering was a built in feature of vim - learned by reading the plugin source. Vim is the gift that keeps on giving.
The only problem is that it's new in vim 7.3, so there are times where I'm forced to use an older version of vim and can't use the feature. I'll look up 10 lines, see "583" and automatically hit 583k without thinking. Not a big deal, and of course I can just do 583G to fix my mistake, but it's definitely some combination of funny and irritating.
Re: Better line numbers for Vim
#10I was at one point very interested in the same idea. I wanted relative line numbers and absolute line numbers integrated together. So, I created a patch, called it `dnu` for "dual line numbering", and sent the suggestion to Bram Moolenaar. Here's what it looked like: http://i.imgur.com/NTwwB.jpg Here was the patch. I wrote it back in 2011: https://code.google.com/r/justinvh-vim/source/detail?r=c2479... Ultimately Bra…
Feature request: allow the user to select separate colors for the relative and absolute line numbers, and for the slash. So three separate colors in total. That would make it easier to read.
Another idea is to have relative line numbers on the left side of the screen, and absolute line numbers on the right (or vice-versa).