Text Objects · Brackets
Delete Inside Brackets
Clear bracket contents while preserving the pair.
di followed by a bracket object searches outward from the cursor, so you do not need to move to either delimiter first.
Use di(, di[, and di{ in the editor beside this lesson. The challenge proves it once; Practice is a timed run against the clock.
Keys in this lesson
- di(
- Delete inside the parentheses, keeping the pair
- di[
- Delete inside the square brackets, keeping the pair
- di{
- Delete inside the braces, keeping the pair
Practice against the clock.
The challenge proves completion once. Practice is a timed run of 15 goals — beat par, then beat your own best time. Every completed goal saves locally.