This poem is perfect. Break it however you like (x, dw, dd — go wild), then press u repeatedly until every change is undone.
roses are red violets are blue undo is a superpower and now so are you
Canonical solution: dd (or any damage), then u until restored · par: 2 keystrokes (vimgolf rules — every keypress counts).
u undoes one change at a time; Ctrl-r redoes. Knowing that u always has your back is what makes the rest of vim feel safe to experiment with.
| Keys | What it does |
|---|---|
| u | undo the last change |
| 5u | undo five changes |
| Ctrl-r | redo |
| U | undo all changes on the current line |
Reading about keystrokes doesn't build keystrokes. Try this in a real vim buffer right now — the “The safety net” mission takes about a minute.
Practice free — no signup →