Next: In C mode, can I show just the lines that will be left after
#ifdef commands are handled by the compiler?, Previous: How do I tell Emacs to automatically indent a new line to the indentation of the previous line?, Up: Common requests [Contents][Index]
show-paren-mode in your .emacs file:
You can also enable this mode by selecting the ‘Paren Match Highlighting’ option from the ‘Options’ menu of the Emacs menu bar at the top of any Emacs frame.
Alternatives to this mode include:
forward-sexp) and C-M-b (
backward-sexp) will skip over one set of balanced parentheses, so you can see which parentheses match. (You can train it to skip over balanced brackets and braces at the same time by modifying the syntax table.)
vi. In addition, if the cursor isn’t over a parenthesis, it simply inserts a % like normal.
;; By an unknown contributor (global-set-key "%" 'match-paren) (defun match-paren (arg) "Go to the matching paren if on a paren; otherwise insert %." (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)))))