Learn Vim / One step in — vim

One step in — vim

The answerCanonical keystrokes: j >>.

Try it on a real buffer

The middle line should be indented under the if. Move onto it (j) and indent it one level with >>.

if ready:
launch()
done()

Canonical solution: j >> · par: 3 keystrokes (vimgolf rules — every keypress counts).

Why it works

>> indents the current line, << dedents it. Give them a count (3>>) or a motion (>j) to hit several lines at once. The shift width follows your shiftwidth setting.

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

Practice free — no signup →

Keep going