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 >> · target: 3 keystrokes — the fewest that solve it (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.

▶ live vim buffertarget 3 keystrokes
The middle line should be indented under the if. Move onto it (j) and indent it one level with >>.

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.

Sign in free to practice →

Keep going