So, Vim, like most programming-minded text editors, highlights a matching “scope” character (such as ( and ), < and >, and { and }).
I’m wondering, is there a motion to reach that character from the other? Like, with the caret on a <, to move to the (highlighted) matching >?
I know [action]t> or [action]f> would accomplish something similar. That’s not what I’m asking.
The motion is:
%.Used alone, this jumps between open/close pairs based on the value of the
matchpairsoption.But angle brackets –
<>– aren’t included by default. They may be set based on thefiletype. The HTML filetype plugin sets it, so if you’re opening HTML files you’ll be able to use%to jump between matching angle brackets. But not for e.g. C++/Java.To add angle brackets if they aren’t jumped when using
%, use:Now using
%on angle brackets should jump to the matching bracket.See
:help 'matchpairs'and:help various-motions–%is the first mentioned – for more details.