Learn Vim / Back it out — vim

Back it out — vim

The answerCanonical keystrokes: j <<.

Try it on a real buffer

The return line is indented too far. Move onto it (j) and dedent it one level with <<.

def total():
    return 42

Canonical solution: j << · target: 3 keystrokes — the fewest that solve it (every keypress counts).

Why it works

<< removes one shiftwidth of indentation; >> adds one. If a line is buried under too much whitespace, stack them (2<<) or just repeat with the dot command.

▶ live vim buffertarget 3 keystrokes
The return line is indented too far. Move onto it (j) and dedent it one level with <<.

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

Sign in free to practice →

Keep going