Learn Vim / Collect the set — vim

Collect the set — vim

The answerCanonical keystrokes: "ayy 2j "Ayy G "ap.

Try it on a real buffer

Gather both list items into register a. Yank the first with "ayy, drop to the second (2j) and APPEND it with "Ayy (capital A appends), then paste both under the header (G then "ap).

- milk
noise line
- eggs
noise line
grocery list:

Canonical solution: "ayy 2j "Ayy G "ap · par: 14 keystrokes (vimgolf rules — every keypress counts).

Why it works

A capital register letter appends instead of overwriting: "ayy then "Ayy leaves both lines stacked in register a. Perfect for collecting scattered lines before pasting them together.

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

Practice free — no signup →

Keep going