One line doesn't belong on this list. Move onto it and delete the entire line with dd.
Shopping list: - eggs - flour DELETE ME I should not be here - butter - sugar
Canonical solution: 3j, then dd · par: 4 keystrokes (vimgolf rules — every keypress counts).
dd deletes the whole current line, wherever the cursor sits on it. (It also copies the line into a register — that will matter later.)
| Keys | What it does |
|---|---|
| dd | delete the current line |
| 3dd | delete three lines |
| dj | delete this line and the one below |
| :5d | delete line 5 without moving there |
| D | delete from the cursor to the end of the line (keep the line) |
Reading about keystrokes doesn't build keystrokes. Try this in a real vim buffer right now — the “Line item veto” mission takes about a minute.
Practice free — no signup →