Smartparens
Minor mode for Emacs that deals with parens pairs
...We generally target GNU Emacs version 24.3 and newer, however, everything should work mostly fine on anything newer than version 24. You can install smartparens from MELPA. Once installed, enable the default configuration. You may want to try smartparens-strict-mode. This enforces that pairs are always balanced, so commands like kill-line keep your code well-formed. Inside Emacs, M-x sp-cheat-sheet will show you all the commands available, with examples. Smartparens has a default configuration that works well for most languages. ...