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 «»「」【】《》]

Emacs, Work with Brackets

ErgoEmacs mascot-s276x226
Buy Xah Emacs Tutorial

Emacs Init

Init Basics

Keys

Font

Text Editing

Completion

File

Restore Things

Backup/AutoSave

Line

Appearance

Misc

Advanced Init Tips

packages