Inserts matching bracket, paren, brace or quote
Switch branches/tags
Nothing to show
Clone or download
Karl Guertin and vim-scripts Version 1.2
Fixed all known bugs (finally). Typing a closing character will now consistently jump out of a match at all times.
Latest commit d50ea9a Jun 19, 2009
Type Name Latest commit message Commit time
Failed to load latest commit information.
plugin Version 1.2 Oct 18, 2010
README Version 1.0.1: Knew I shouldn't have uploaded the first version as 1.0 Oct 18, 2010


This is a mirror of

There are very simple ways to insert a closing brace by setting up a few mappings. The problem with all these approaches is that they break undo, history or both. This script is my sixth attempt at correcting this problem and the first one that has worked in all scenarios.

Using this script, typing ``(`` will result in (|), where | is the cursor position and the double backticks are just marking input. Typing a ``)`` will move the cursor outside the parens. This moving outside works even in nested scenarios. Typing ``if(my_array['key`` results in if(my_array['key|']) and ``)`` gets you if(my_array['key'])|.

The paired characters are: [, (, {, ", '

If you like this script, you should also check out surround.vim