It is a fork from the brilliant rainbow-delimiters, base it, I develop the feature of emphasising delimiters of current cursor mode. Since I change too much of it, So I make a new repo to develop it.
You can install it manually, steps:
- download pair-colorizer.el
- put it into your load directory, ie:
(add-to-list 'load-path "~/.emacs.d/xx/xx")
(require 'pair-colorizer)
You can also use package-install-from-buffer
to install it.
To toggle the pair-colorizer-mode
in the current buffer:
M-x pair-colorizer-mode
At default, the pair-colorizer-emphasise
is enable, if you don’t like it, you can turn it off by follows:
(custom-set-variables '(pair-colorizer-emphasise nil))
To start the mode automatically in most programming modes (Emacs 24 and above):
(add-hook 'prog-mode-hook #'pair-colorizer-mode)
You can set your own rainbow colors use:
;; for light background
(setq pair-colorizer-light-colors ["#xx" "#xx"])
;; for dark background
(setq pair-colorizer-dark-colors ["#xx" "#xx"])
You can also use customize-group to customize various options, including the color theme:
M-x customize-group <RET> pair-colorizer
You can specify faces by customizing following faces:
- The unmatched delimiter face:
pair-colorizer-unmatched-face
. - The mismatched delimiter face:
pair-colorizer-mismatched-face
.
You can change the strategy of picking colorized face or emphasised face for a certain depth.
- To pick a face used to highlight a delimiter:
pair-colorizer-pick-face-function
- To pick a face used to emphasise a delimiter of current cursor:
pair-colorizer-emphasise-pick-face-function
.
Below is my configuration.
(custom-set-variables '(pair-colorizer-emphasise t))
(custom-set-faces
'(pair-colorizer-unmatched-face ((t (:foreground "#ff5370" :inverse-video t :weight bold))))
'(pair-colorizer-mismatched-face ((t (:inherit pair-colorizer-unmatched-face))))
(setq pair-colorizer-dark-colors
["#c792ea" "#f78c6c" "#c3e88d" "#89DDFF" "#bb80b3"
"#ffcb6b" "#82aaff" "#44b9b1" "#80cbc4"])
Hope it will help you!
And I’ll appreciate it if you can star this repo.
If you have any bugs, please issue it, help me make it better!