Three junk lines sit together. Put the cursor on the first junk line and press 3dd — a count multiplies any command.
keep: the mission briefing junk: shredder food junk: more shredder food junk: even more shredder food keep: the victory speech
Canonical solution: j 3dd · par: 4 keystrokes (vimgolf rules — every keypress counts).
Counts work everywhere: 3dd deletes three lines, 5x deletes five characters, 2yy yanks two lines, 4w hops four words. Think in multiples.
| Keys | What it does |
|---|---|
| 3dd | delete 3 lines |
| dj | delete this line + the next |
| :2,5d | delete lines 2–5 by number |
| VG d | visual-select to end of file, delete |
| :g/pattern/d | delete every line matching a pattern |
Reading about keystrokes doesn't build keystrokes. Try this in a real vim buffer right now — the “Triple threat” mission takes about a minute.
Practice free — no signup →