In GNU Emacs there is a feature to highlight matching brackets in code with the same colour.
However when the code which the brackets enclose is really long with severa
(defun px-match-paren (arg)
"Go to the matching paren if on a paren; otherwise insert ."
(interactive "p")
(cond
((char-equal 41 (char-before)) (backward-list 1))
((char-equal 125 (char-before)) (backward-list 1))
((and
(char-equal 123 (char-before))
(char-equal 10 (char-after)))
(backward-char 1) (forward-list 1))
((looking-at "\\s\(") (forward-list 1))
((looking-at "\\s\)") (backward-list 1))
(t (self-insert-command (or arg 1)))))
The
to witch you bind this command will toggle opening and closing brace if point is before or after it, otherwise insert
(much like vi's "%")
I also bind C-
to forward-sexp
and C-S-
to backward-sexp
so I can really quickly navigate through functions in the file.