In emacs there is a mode show-paren-mode
which colors the opposite matching parenthesis when the cursor is on the other. I wrote an example explaining show-paren-mode
:
( <-colored colored-> )| <-cursor
However it does not work when the cursor is not on the parenthesis:
( <-not colored cursor inside->| not colored-> )
How can I enable this? I find that when performing slurpage and barfage in paredit I cannot keep track of the parentheses very well because they are not colored unless I am on them.
This is optimal:
( <-colored cursor inside->| colored-> )
Edit: Thanks to the comment by @lawlist I have resolved this issue.
This works well for me (more recent Emacs version (than 25?) may be required for the new advice implementation):
(define-advice show-paren-function (:around (fn) fix)
"Highlight enclosing parens."
(cond ((looking-at-p "\\s(") (funcall fn))
(t (save-excursion
(ignore-errors (backward-up-list))
(funcall fn)))))
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