Mission 27 / 52• Text Objects - Bracket Pairs

Intro to Text Objects

Text objects are Vim's superpower. Instead of moving character-by-character or selecting with a mouse, you command Vim to edit semantic code structures.

The formula is `[operator] + [i or a] + [object]`. `i` means *inside* (content only), while `a` means *around* (content plus surrounding delimiters).

Text object structure

  • i{obj}inside text object (excludes enclosing delimiters)
  • a{obj}around text object (includes enclosing delimiters)
1
const user = { name: "John", age: 30 };
2
function run() { return true; }

With text objects, your cursor just needs to be *somewhere inside* the brackets. You don't have to navigate to the boundary!

Now it's your turn!

0 / 4 tasks complete0.0s / 15s par0 / 12 par

Practice this lesson's commands. Each task checks your technique and the result, not just your cursor position. Take your time.

Task 1: Clear the arguments with di( while keeping the parentheses.

Expected result
send();
Show hint

Use di( inside the argument list.

1
send(message, retry);
jkscroll•ggGtop/bottom•Tabnext example•Enterstart•qstop•Ctrl+kCtrl+jprev/next