With the cursor anywhere on line 1, press ci" to change everything inside the quotes, type exactly hello, world then Esc.
greeting = "wrong message" print(greeting)
Canonical solution: ci" hello, world Esc · par: 16 keystrokes (vimgolf rules — every keypress counts).
ci" finds the quotes on the current line even if the cursor isn't inside them yet. The family is huge: i" / a" (inside / around quotes), i( , i{ , i[ , it for HTML tags…
| Keys | What it does |
|---|---|
| ci" | change inside double quotes |
| ci' | change inside single quotes |
| di" | delete inside quotes |
| yi" | copy inside quotes |
| ci( ci{ ci[ | same idea for brackets |
Reading about keystrokes doesn't build keystrokes. Try this in a real vim buffer right now — the “Fix the string” mission takes about a minute.
Practice free — no signup →