Live data from Hacker News

Relative Line Numbers in Vim

jeffkreeftmeijer.com

11–20 of 40 posts

Re: Relative Line Numbers in Vim

#11

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.

The OP says it's new in version 7.3 I also wish it was done earlier since I found myself trying to use commands like '5j' and giving up a long time ago.

Re: Relative Line Numbers in Vim

#12

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?

I see considerable slowdown when using just vim on OSX. It could be a fault of something else, but I also find my 'b'ack word slowed down considerably as well.

Re: Relative Line Numbers in Vim

#13
post #9

Relative line numbers may be useful at first, but they quickly show their limitation when one needs to jump to a specific line.

I find relative numbers distracting (because they change), and don't use them, but that's definitely not a problem in Vim: you can jump to a specific line very easily by typing e.g. "123G", regardless of whether line numbers are visible.

Re: Relative Line Numbers in Vim

#14

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?

Yes! Usually it's not a problem, but every now and then relativenumber really kills performance.

The last time I noticed this was with valgrind logs; and I have no idea what exactly is causing it (amount of lines doesn't seem to be it).

Thankfully it's perfectly usuable for day-to-day editing. Binding :set rn! to a key circumvents this problem well enough.

Re: Relative Line Numbers in Vim

#16

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?

Have you tried the "experimental renderer" feature of MacVim? It made my unbeatably slow MacVim work fine.

Re: Relative Line Numbers in Vim

#18
post #15

spf13 is a great plugin bundle for vim that got me started using relative line numbering. It's great for the lazy person who doesn't want to bother setting up all the fancy vim plugins and settings. https://github.com/spf13/spf13-vim

Lazy persons get the crap they deserve with SPF13.

Re: Relative Line Numbers in Vim

#19
post #17

I used to use relative line numbers until I learned about dG. For example, I can use 8dG to delete from my cursor to (and including) line 8. Also works with yanking, e.g. 8yG.

Relative line numbers for LIFE! :D

d3j (delete 3 down) and y3j (yank 3 down) do the same things, but relative. I don't even need to look at the relative numbers anymore really. For short hops I just guess. I'm right most of the times.

Post reply on HN