Skip to content

Instantly share code, notes, and snippets.

@blackball
Created November 27, 2013 06:15
Show Gist options
  • Select an option

  • Save blackball/7671419 to your computer and use it in GitHub Desktop.

Select an option

Save blackball/7671419 to your computer and use it in GitHub Desktop.
set the colors of bracklets/braces/... for C and C++ mode
(defface paren-face
'((((class color) (background dark))
(:foreground "grey80"))
(((class color) (background light))
(:foreground "grey40")))
"Face used to dim parentheses.")
(defface paren-face-2
'((((class color) (background dark))
(:foreground "grey40"))
(((class color) (background light))
(:foreground "grey80")))
"Face used to dim parentheses.")
(add-hook 'c-mode-common-hook (lambda () (font-lock-add-keywords nil
'(("(\\|)" . 'paren-face)
("\\[\\|]" . 'paren-face)
("{\\|}" . 'paren-face-2)))))
(add-hook 'c++-mode-common-hook (lambda () (font-lock-add-keywords nil
'(("(\\|)" . 'paren-face)
("\\[\\|]" . 'paren-face)
("{\\|}" . 'paren-face-2)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment