views:

3202

answers:

3

Hi,

What is the command to match brackets in Emacs (the equivalent of the '%' command in vim)?

+7  A: 

5.29 How do I show which parenthesis matches the one I'm looking at?

Alexander Kojevnikov
I love this website! Thank you
Chris Huang-Leaver
No worries mate :)
Alexander Kojevnikov
+3  A: 

C-M-f, or M-x forward-sexp, goes forward to the closing brace, or to the opening brace in the next set of braces. C-M-b, or M-x backward-sexp, goes backward to the opening brace, or to the closing brace in the next set of braces. These commands will work for parentheses, square brackets, curly braces, angle brackets, etc., and can be customized to recognize other delimiters.

Chris Conway
A: 

There is also a 'show-paren-mode'. For navigation, I think it's better C-M-nand C-M-n

wallyqs
Yes, but sometimes the matching paren isn't currently on the screen. This is when forward/backward-sexp really come in handy.
Chris Conway