Counting j presses is for tourists. Jump straight to line 10 with 10G (or :10 and Enter), then delete that line with dd.
line 1: keep line 2: keep line 3: keep line 4: keep line 5: keep line 6: keep line 7: keep line 8: keep line 9: keep line 10: DELETE ME line 11: keep line 12: keep
Canonical solution: 10G dd · par: 5 keystrokes (vimgolf rules — every keypress counts).
G goes to the last line, gg to the first, and a number before G goes to that exact line. Ex commands work too: :10 jumps to line 10.
| Keys | What it does |
|---|---|
| 10G | jump to line 10 |
| :10 | same, as an ex command |
| gg | jump to the first line |
| G | jump to the last line |
| 50% | jump halfway through the file |
Reading about keystrokes doesn't build keystrokes. Try this in a real vim buffer right now — the “Teleportation” mission takes about a minute.
Practice free — no signup →