Learn Vim / A labelled drawer — vim

A labelled drawer — vim

The answerCanonical keystrokes: j "ayy.

Try it on a real buffer

Stash the deploy_token line in register a for later. Move onto it (j), then yank the whole line into register a with "ayy. The file must stay unchanged.

scratch notes, ignore these
deploy_token = "keep-me-safe-042"
more scratch, also ignore

Canonical solution: j "ayy · target: 5 keystrokes — the fewest that solve it (every keypress counts).

Why it works

Prefix any yank or delete with "{letter} to target a named register: "ayy yanks into a, "ap pastes from it. You have 26 labelled drawers (a–z) that survive while the unnamed register gets overwritten.

▶ live vim buffertarget 5 keystrokes
Stash the deploy_token line in register a for later. Move onto it (j), then yank the whole line into register a with "ayy. The file must stay unchanged.

Reading about keystrokes doesn't build keystrokes. Try this in a real vim buffer right now — the “A labelled drawer” mission takes about a minute.

Sign in free to practice →

Keep going