Copy the 3rd word of line 10. Jump with 10G, go to the line start with 0, hop two words with 2w, then yank the inner word with yiw. Don't change the file.
nothing to see on line one line two is just filler line three keeps the count honest line four, still scrolling line five has no treasure line six is deliberately boring line seven, keep going line eight, almost there line nine, one more grab the emerald from this line line eleven, you went too far line twelve, way too far
Canonical solution: 10G 0 2w yiw · par: 7 keystrokes (vimgolf rules — every keypress counts).
Counts multiply motions: 2w = w twice. yiw yanks the “inner word” under the cursor — no trailing space. You'll meet more of these text objects soon.
| Keys | What it does |
|---|---|
| yiw | copy the word under the cursor |
| yaw | copy the word plus its space |
| ye | copy to the end of the word |
| 2w yiw | hop two words, then copy |
Reading about keystrokes doesn't build keystrokes. Try this in a real vim buffer right now — the “The emerald heist” mission takes about a minute.
Practice free — no signup →