In addition to jumping to the corresponding
%, Vim has
another little-known feature for showing corresponding parens when inserting.
Vim’s showmatch feature might be useful for those writing code with many
nested parentheses, such as Lisp. With
:set showmatch enabled, while in
insert mode after typing a paren, brace, or bracket, the cursor will
automatically jump to the matching brace briefly. Just long enough for you to
confirm which parenthesis you are closing.
You can change the time the cursor spends there before bouncing back with matchtime.
And if you’re working on a tiny screen, or text with parens that span many lines, you may wish to have the screen scroll automatically when showmatch is enabled. 1
Add this to your .vimrc:
1. Move to matching braces. (n.d.). In Wikia. Retrieved June 4, 2017, from http://vim.wikia.com/wiki/Moving_to_matching_braces