Paredit is a minor mode for keeping parenthese balanced. It is extremely useful for working with lisp-based programming languages. Also, it is activated automatically when you open any lisp-based languages file. Usually in other languages, we have to work with parentheses, too. For example the { and } for code block, [ and ] for array… To use paredit with non-lisp mode, add the following function into your .emacs file

Actually, this is taken from Emacs Starter Kit so if you are using Emacs Starter Kit, the above function is added already for you as esk-paredit-nonlisp. Emacs Starter Kit also activates it by default for you in some modes (javascript for example). Now, if you want to activate paredit for a certain mode, add this to your .emacs