Better line numbers for Vim
11–20 of 46 posts
Re: Better line numbers for Vim
#12Say I want to move 6 lines down. I use 6j, but one of the lines I want to jump over is wrapped and occupies 2 lines in my editor. That will mean my cursor will end up at the line that was previous numbered 5. This behavior drives me nuts.
Re: Better line numbers for Vim
#13I 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…
Re: Better line numbers for Vim
#14I 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…
This looks quite useful to me. 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).
On a side note, to your second request of left-side/right-side splits for line numbers: my first experimentation was to do just that. Left side was rnu and right side was nu, but the way vim's buffers work out, it wasn't very practical. It also caused headaches for rtl text and so on if I remember correctly.
Re: Better line numbers for Vim
#15That said, put me in the category of crotchety old Vim users (even though I'm only 20) who really don't have a use for this. Potential use cases:
Scrolling: If it's a few lines, I tap j a few times--or guesstimate a number prefix. It's just scrolling--no precision needed. If it's more than a few lines, I use C-d/C-u. If I need to teleport to a line I know about, : is fine.
Yanking/Deleting/Changing/Indenting: I turn on visual line mode (V), and proceed as above. Or, depending on the language I'm in, I'll do, for example, yi{ to yank everything in the current block. Or use () judiciously.
So...what's the actual use case for this? Not trying to be critical--I just want to understand how I'd integrate it into my workflow.
Re: Better line numbers for Vim
#16I 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…
In my vim doesn't show the 0 instead it shows the line number you're currently on. Seems somewhat what you suggested.
Re: Better line numbers for Vim
#17My problem with relative numbering is that it doesn't seem to work correctly when a line is wrapped. Say I want to move 6 lines down. I use 6j, but one of the lines I want to jump over is wrapped and occupies 2 lines in my editor. That will mean my cursor will end up at the line that was previous numbered 5. This behavior drives me nuts.
Re: Better line numbers for Vim
#18If it's useful to other people--and obviously it is--it was worth writing, so congratulations on shipping. That said, put me in the category of crotchety old Vim users (even though I'm only 20) who really don't have a use for this. Potential use cases: Scrolling: If it's a few lines, I tap j a few times--or guesstimate a number prefix. It's just scrolling--no precision needed. If it's more than a few lines, I use C-d…
Re: Better line numbers for Vim
#19Earlier quoted context omitted.
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.
I went to relative numbering a while ago and I can't go back. It's awesome. 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 irritati…
Re: Better line numbers for Vim
#20If it's useful to other people--and obviously it is--it was worth writing, so congratulations on shipping. That said, put me in the category of crotchety old Vim users (even though I'm only 20) who really don't have a use for this. Potential use cases: Scrolling: If it's a few lines, I tap j a few times--or guesstimate a number prefix. It's just scrolling--no precision needed. If it's more than a few lines, I use C-d…