Hacker News new | ask | show | jobs
by nrds 481 days ago
Counting anything in vim is an antipattern.

    :set rnu
    :set nu
will change the gutter to display relative line numbers for all but the current line.

FWIW I would very rarely if ever use '5dd'; to me that is spelled 'd4j'. ':set rnu' obviously influences this, since the last line to be copied is labeled '4'.

Undo is 'u' and, yeah, you probably need to know that one before starting. Even after over 15 years using vim I still make tons of mistakes and change my mind, and a fairly robust undo system is crucial.

1 comments

I have tried setting relative numbering, but because I need to look at the gutter to read it, it would be faster to just hold shift+down in VS code if I need to do something with 5 lines of code, and if it's a lot of lines, just use the mouse, or press page down, or ctrl+shift+end if it's all the way to the end.
v/V mode is right there for block selection.