Assumption: You want to end up at the line you started on.
My answer: jddk
- j (moves down)
- dd (deletes current line)
- k (moves up)
Try it – it's quick! In fact, it's two keystrokes less than the currently accepted answer because:
- you don't need to hold
[Shift]
to enter the colon ':' and plus '+' characters, and
- you don't need the implied
[Enter]
at the end of the sequence, since jddk
is entered all in visual mode as opposed to command mode.
Plus, jddk
is all on home row of the keyboard.
I spent a long time using h, j, k, l to navigate in vi
, long before the terminal emulation software I used started supporting arrow keys. (I'm talking about ~20 years ago ;-)
1hjkl is faster anyway. I've never used a keyboard that didn't have arrow keys on it, and I began to greatly value the efficacy of these keymappings about 10 minutes after I stopped being annoyed at the unintuitiveness of them. – intuited – 2010-04-17T22:44:37.350