Match nested delimiters

0 of 1

The technique

Your textVim mode: Normal
Jump from the first opening bracket to its partner. Before: outer(inner(value)). After: outer(inner(value)).

It lands on the last bracket, the true partner, not on the first closing bracket it meets.

Keys in this lesson

%
The matching bracket.
d%
Delete to the matching bracket, brackets included.

Before this lesson: Choose the whole pair.

More about this lesson

Use matching structure instead of the next identical character.

% on a bracket moves to its matching partner, including nested pairs. d% removes the pair and its contents. A character search only finds a character; it does not understand the matching nesting. Inspect the desired result before including delimiters.

Example

On the opening parenthesis in outer(inner(value)), % reaches the final closing parenthesis, not the inner one.

Use Reset to try again.

Guides on this topic

Exercise 1 of 1

0keys

par 1

Reach the matching outer closing delimiter, passing over the nested region. Finish at line 1, column 35.

Your textVim mode: Normal

Desired result

Yours

Par

Keyboard shortcuts
Ctrl+Enter
Check the result
Ctrl+Alt+U
Undo the last change
Ctrl+Alt+H
Show the next hint
Ctrl+Alt+R
Reset the exercise
Ctrl+Alt+P
Previous exercise
Ctrl+Alt+N
Next exercise
Enter
After a solve: the next step

Ctrl+Alt shortcuts leave Vim's own keys alone. On a Mac, Control and Option.