What is the command to match brackets in Emacs (the equivalent of the %
command in Vim)?
The % key. You can use the % key to jump to a matching opening or closing parenthesis, square bracket or a curly brace.
To jump to the matching bracket, press Ctrl+Shift+P.
See show-paren-mode
as described in 5.27 How do I show which parenthesis matches the one I'm looking at?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With