Emacs: Highlight Brackets

By Xah Lee. Date: . Last updated: .
Alt+x show-paren-mode
highlight matching brackets when your cursor is on a bracket. In emacs init file, use (show-paren-mode 1)
emacs show-paren-mode 2021-09-30 dnSk
emacs show-paren-mode, highlight brackets

show-paren-mode has 2 styles of highlighting brackets. By default, emacs highlights just the brackets.

To change a style, put one of this in your emacs init file:

;; highlight brackets
(setq show-paren-style 'parenthesis)
;; highlight entire expression
(setq show-paren-style 'expression)
;; highlight brackets if visible, else entire expression
(setq show-paren-style 'mixed)

Note: show-paren-mode will highlight any brackets, including [] {} 『』 【】 〈〉 «» etc.

[see Unicode: Brackets, Quotes «»「」【】《》]

Put $5 at https://www.patreon.com/xahlee , or goto paypal.com and pay to Xah@XahLee.org . Message me on XahLee discord, say so, ask me questions.
Or Buy Xah Emacs Tutorial

Emacs Tutorial

Emacs Init

Emacs Keys


ELisp Examples

ELisp Write Major Mode

Emacs Init

Init Basics


text editing