Relative Line Numbers in Vim
jeffkreeftmeijer.com
Relative Line Numbers in Vim
1–10 of 40 posts
Re: Relative Line Numbers in Vim
#2Is this a commonly known feature? Because I have never seen it before. I wish I had been introduced to it about 10 years ago.
Re: Relative Line Numbers in Vim
#3Is this a commonly known feature? Because I have never seen it before. I wish I had been introduced to it about 10 years ago.
I saw it in Learn Vimscript the Hard Way. I assumed it was common knowledge, since I couldn't see any other practical way to use 5j, etc, on a regular basis, but it's apparently less well-known than I thought.
Re: Relative Line Numbers in Vim
#4Is this a commonly known feature? Because I have never seen it before. I wish I had been introduced to it about 10 years ago.
Apparently, it has been introduced in 7.3, which is pretty recent.
Re: Relative Line Numbers in Vim
#5Is this a commonly known feature? Because I have never seen it before. I wish I had been introduced to it about 10 years ago.
Yeah I had the same reaction last September when I saw https://news.ycombinator.com/item?id=4496578. But my git history shows I disabled it again a day later. Maybe enabling it just in normal mode will make it stick this time.
Re: Relative Line Numbers in Vim
#6Rather than switching between rnu and nu, I simply have `set rnu` and absolute line number in my status line.
Re: Relative Line Numbers in Vim
#7I recommend the EasyMotion plugin. It allows you to do this via ,j or ,k (assuming your leader key is set to ,). If you want to move to a specific character in a line you can also use the w/b and f/F motions (with a leading comma).
https://github.com/Lokaltog/vim-easymotion (there's an animated demonstration on the bottom of the readme)
Re: Relative Line Numbers in Vim
#8I have used (and like) relative line numbers for a while now. However, when using MacVim full-screen on large (high resolution) screens, the relativenumber and cursorline slow down redraws considerably on my Macs, to the point where it annoys me a lot.
Does anyone else have the same experience and perhaps a solution?
Re: Relative Line Numbers in Vim
#9Relative line numbers may be useful at first, but they quickly show their limitation when one needs to jump to a specific line.
Re: Relative Line Numbers in Vim
#10For the Emacs users, check out https://github.com/coldnew/linum-relative
And for those with the melpa repository set up, it can be found as the "linum-relative" package.