I am using Emacs: Highlight Brackets ()[]{}.
I want to highlight matching brackets when the cursor is behind and front of starting and ending brackets. How can I accomplish this?
foo ( "hello" )
^ ^ ^ ^
1 2 3 4 // cursor points
I have followed @Gilles 'SO- stop being evil'
s answer for Changing show-paren-mode Areas:
(defadvice show-paren-function
(around show-paren-closing-before
activate compile)
(if (eq (syntax-class (syntax-after (point))) 5)
(save-excursion
(forward-char)
ad-do-it)
ad-do-it))
which helped me to highlight brackets cursor points 1, 3, 4
, but it does not highlight when on 2nd cursor point.
My setup is:
(show-paren-mode 1)
(setq show-paren-delay 0)
(setq show-paren-style 'parenthesis)
(defadvice show-paren-function
(around show-paren-closing-before
activate compile)
(if (eq (syntax-class (syntax-after (point))) 5)
(save-excursion
(forward-char)
ad-do-it)
ad-do-it))
(require 'paren)
(setq show-paren-style 'parenthesis)