Emacs: Highlight Brackets

By Xah Lee. Date: . Last updated: .
Alt+x show-paren-mode
highlight matching brackets when your cursor is on a bracket.

Note: it highlights any bracket, including [] {} 『』 【】 〈〉 «» etc. [see Unicode: Brackets, Quotes «»「」【】《》]

emacs show-paren-mode 2021-09-30 dnSk
emacs show-paren-mode, highlight brackets

Set in Init File

put this in your Emacs Init File:

;; highlight matching paren
(show-paren-mode 1)

Styles of Show Matching Paren

put 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)

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