%
The
Motion
The % command in Vim
Motion
goto match
Jump to the matching bracket, paren, or brace under/after the cursor. With a count (e.g.
50%), jump to that percentage of the file. Enable matchit (built-in, not loaded by default) with :packadd matchit for HTML/XML tag and if/end matching.Examples
%(jump to match)d%(delete to match)v%(select to match)50%(go to middle of file):packadd matchit (enable tag matching)
Related plugin
andymass/vim-matchup — Extends % to match if/else/end, HTML/XML tags, and language-specific block pairs. Drop-in replacement for the built-in matchit.
Reference
Learn every Vim command visually — right in your browser.
Add Vim What? to Chrome — FreeAlso on Firefox.
Related motions