Smartparens
Minor mode for Emacs that deals with parens pairs
... available, with examples. Smartparens has a default configuration that works well for most languages. For language-specific behaviour, smartparens has a separate smartparens-FOO.el file for every language and smartparens-config.el loads these automatically.