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 << · par: 3 keystrokes (vimgolf rules — 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.

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.

Practice free — no signup →

Keep going