Re:Relative Line Numbers in Vim
by reledi on Monday June 03, 2013 @05:12AM
(#5812159)
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.
[ Parent
| on HN ]
Re:Relative Line Numbers in Vim
by AlexanderDhoore on Monday June 03, 2013 @05:39AM
(#5812246)
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.
Absolute line numbers are more convenient for me. Relative line numbers didn't give me any advantage after I learned about the G command. That command is also useful for going to the bottom of the file (G) or to the top of the file (1G). With absolute line numbers I don't have the line numbers changing all the time, which was distracting. It's also easier to open files at a specific line.
gg will take you to the top of the file too