Match nested delimiters
The technique
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.