• Home
  • Shell
    • Emacs
    • Perl
    • screen
    • sed
  • Ubuntu
    • VNC
  • Web Development
    • Javascript
    • Joomla
    • MySQL
    • osTicket
  • Windows
    • Gimp

Emacs> Use % to jump to the matching parenthesis/brackets

Oct26
2010
Written by Scott Rowley

Found the following while working on other emacs configurations, works great for when your code gets out of hand:

;;; Use "%" to jump to the matching parenthesis.
(defun goto-match-paren (arg)
"Go to the matching parenthesis if on parenthesis, otherwise insert
the character typed."
(interactive "p")
(cond ((looking-at "\s(") (forward-list 1) (backward-char 1))
((looking-at "\s)") (forward-char 1) (backward-list 1))
(t (self-insert-command (or arg 1))) ))
(global-set-key "%" `goto-match-paren)
Posted in Emacs - Tagged bracket, edit, Emacs, jump, parenthesis, search
« BASH> How to install perl modules through CPAN on Ubuntu
» osTicket> Mass ‘Ban & Delete’

Corrections? Questions? Comments?

Find an error?
Everything work out great for you?
Have some feedback?
Like to see something added to the article?

PLEASE leave us a comment after the article and let us know how we are doing, or if something needs corrected, improved or clarified.

Thank you!
- The Management

Advertisement

Sudo Bash
By Geeks - For Geeks

Back to Top