Learn Vim / The assembly line — vim

The assembly line — vim

The answerCanonical keystrokes: record a key=value → value→key transform, then @a down the list.

Try it on a real buffer

Turn each “key = value” into “value → key”. Record a macro on line 1 (qa …something clever with dw, $, etc… q), then replay it down the list. Any recording that produces the target passes — this is your macro black belt.

host = localhost
port = 8080
user = admin

Canonical solution: record a key=value → value→key transform, then @a down the list · par: 40 keystrokes (vimgolf rules — every keypress counts).

Why it works

A robust macro starts from a known spot (0 or ^), does its work with motions and text objects (not arrow keys or fixed counts that break on different line lengths), and ends by moving to the next line so it replays cleanly.

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

Practice free — no signup →

Keep going