Skip to content
Vim Learn
Learn/

Delete Inside Brackets

27 / 51

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
All 91 keys →

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.

di(

Delete only the contents of the parentheses with di(.