Hacker News new | ask | show | jobs
by chousuke 3979 days ago
I think your example is somewhat badly chosen.

If I had to delete four lines, I'd most likely mash dd until done, or maybe Vjjjd. It would be completely automatic and not require reaching for numbers or the arrow keys, making it significantly faster and more comfortable as well.

I find that vim is extremely good for reading code, since navigating around a file is very easy (and I am in no danger of accidentally editing code while not in insert mode.).

Not having to reach for the arrow keys while navigating is a huge plus as well, since it keeps my fingers on the same position whether I am typing or navigating.

EDIT: Vjjjd, not Vjjjjd. Drives home the point that it's automatic, since I can't get it right if I think about it...

2 comments

And in true TMTOWTDI fashion, I'd add that depending on what the four lines were (in relation to my cursor and their content and, frankly, whatever pops into my head first), I'd probably do 4dd, or d4j, or d] or d} (if the final line was the end of my current sentence or paragraph) or d2] if it was two sentences.

My favourite bit is that I use which one pops into my head first. If I think "until the next occurrence of 'nded?'" then that's what I do, with d/nded?<RET>. If I think "up to line 438" then I can do d438g. It reduces the number of decisions I have to make, which increases my mental stamina.

Great point about reading the file. I feel paranoid when using a text editor like sublime now just arrow key-ing or scrolling around a file since hitting practically any key will insert or delete a character!
This is why any decent text editor or IDE has an UNDO method.