The function body forgot its indentation. Select lines 2–4 with j V jj, then press > to indent the whole selection one level.
def greet():
print("hello")
print("world")
return True
Canonical solution: j V jj > · par: 4 keystrokes (vimgolf rules — every keypress counts).
> indents, < dedents; in visual mode they act on the selection and drop you back to normal mode. As an operator: >j indents this line and the next, >2j grabs three.
| Keys | What it does |
|---|---|
| Vjj > | indent three lines |
| >2j | indent three lines without visual mode |
| gv | reselect to indent again |
| = | auto-indent the selection |
Reading about keystrokes doesn't build keystrokes. Try this in a real vim buffer right now — the “Push it in” mission takes about a minute.
Practice free — no signup →