Skip to content

Instantly share code, notes, and snippets.

@donghee
Created October 23, 2012 08:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donghee/3937661 to your computer and use it in GitHub Desktop.
Save donghee/3937661 to your computer and use it in GitHub Desktop.
emacs elisp: goto matching parenthesis
(defun jump-match-paren (arg)
"Go to the matching parenthesis."
(interactive "p")
(cond ((looking-at "\\s\(\\|\\s\[") (forward-list 1) (backward-char 1))
((looking-at "\\s\)\\|\\s\]") (forward-char 1) (backward-list 1))
(t (back-to-indentation))
))
(global-set-key [C-return] 'jump-match-paren)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment