Live data from Hacker News

Relative Line Numbers in Vim

jeffkreeftmeijer.com

1–10 of 40 posts

Re: Relative Line Numbers in Vim

#3

Is 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

#5

Is 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

#7
I 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

#8
I 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?

Post reply on HN