From 9b5b7dfcc98d957db6703115cf03fc4ebc4c4228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Tue, 7 Aug 2018 22:33:22 -0500 Subject: [PATCH] rainbow-mode: colorize color names in buffers (css, less, sass, scss) --- custom.el | 2 +- init.el | 2 ++ lisp/init-rainbow.el | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 lisp/init-rainbow.el diff --git a/custom.el b/custom.el index 28cdeb2..69fbb04 100644 --- a/custom.el +++ b/custom.el @@ -11,7 +11,7 @@ '(anzu-search-threshold 1000) '(package-selected-packages (quote - (scss-mode sass-mode less-css-mode ac-php smarty-mode php-mode pkgbuild-mode markdown-mode flycheck anzu sml-modeline smart-mode-line-powerline-theme smart-mode-line nlinum sublime-themes)))) + (rainbow-mode scss-mode sass-mode less-css-mode ac-php smarty-mode php-mode pkgbuild-mode markdown-mode flycheck anzu sml-modeline smart-mode-line-powerline-theme smart-mode-line nlinum sublime-themes)))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/init.el b/init.el index 151c5c0..87aa87a 100644 --- a/init.el +++ b/init.el @@ -43,6 +43,8 @@ (require 'init-less) (require 'init-sass) (require 'init-scss) +;; Plus +(require 'init-rainbow) ;;; Loads custom file (when (file-exists-p custom-file) diff --git a/lisp/init-rainbow.el b/lisp/init-rainbow.el new file mode 100644 index 0000000..4461279 --- /dev/null +++ b/lisp/init-rainbow.el @@ -0,0 +1,10 @@ +;; rainbow-mode +(require-package 'rainbow-mode) +(add-hook 'css-mode-hook 'rainbow-mode) +(add-hook 'sass-mode-hook 'rainbow-mode) +(add-hook 'scss-mode-hook 'rainbow-mode) +(add-hook 'less-mode-hook 'rainbow-mode) +(add-hook 'web-mode-hook 'rainbow-mode) +(add-hook 'html-mode-hook 'rainbow-mode) + +(provide 'init-rainbow)