2015-01-14 04:12:56 +00:00
|
|
|
;;; packages.el --- Colors Layer packages File for Spacemacs
|
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
2015-01-14 04:12:56 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
2015-04-19 03:40:24 +00:00
|
|
|
(setq colors-packages
|
2014-12-18 05:12:04 +00:00
|
|
|
'(
|
2015-01-24 05:03:40 +00:00
|
|
|
;; not working well for now
|
|
|
|
;; rainbow-blocks
|
2016-01-18 03:06:04 +00:00
|
|
|
(nyan-mode :location local)
|
2015-09-08 07:40:23 +00:00
|
|
|
color-identifiers-mode
|
2015-01-27 05:29:31 +00:00
|
|
|
rainbow-identifiers
|
2015-01-24 05:03:40 +00:00
|
|
|
rainbow-mode
|
2015-04-19 03:40:24 +00:00
|
|
|
))
|
2014-12-18 05:12:04 +00:00
|
|
|
|
2015-05-07 04:13:13 +00:00
|
|
|
;; (defun colors/init-rainbow-blocks ()
|
|
|
|
;; (use-package rainbow-blocks
|
|
|
|
;; :disabled t
|
|
|
|
;; :init (add-hook 'emacs-lisp-mode-hook 'rainbow-blocks-mode)))
|
2015-01-24 05:03:40 +00:00
|
|
|
|
2016-01-18 03:06:04 +00:00
|
|
|
(defun colors/init-nyan-mode ()
|
|
|
|
(use-package nyan-mode
|
|
|
|
:if colors-enable-nyan-cat-progress-bar
|
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(setq nyan-wavy-trail t)
|
|
|
|
(setq nyan-animate-nyancat t)
|
|
|
|
(nyan-mode)
|
|
|
|
;; explicitly re-enable the cat for the first GUI client
|
|
|
|
(spacemacs|do-after-display-system-init
|
|
|
|
(nyan-mode -1)
|
|
|
|
(nyan-mode))
|
|
|
|
|
|
|
|
(spacemacs|add-toggle nyan-cat-progress-bar
|
2016-05-31 13:11:00 +00:00
|
|
|
:mode nyan-mode
|
2016-01-18 03:06:04 +00:00
|
|
|
:documentation "Show a nyan cat progress bar in the mode-line."
|
|
|
|
:evil-leader "tmn"))))
|
|
|
|
|
2015-09-08 07:40:23 +00:00
|
|
|
(defun colors/init-color-identifiers-mode ()
|
|
|
|
(use-package color-identifiers-mode
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-09-08 07:40:23 +00:00
|
|
|
:init
|
|
|
|
(progn
|
2016-06-04 03:29:59 +00:00
|
|
|
(when (eq 'variables colors-colorize-identifiers)
|
2018-06-11 05:53:05 +00:00
|
|
|
(add-hook 'prog-mode-hook 'color-identifiers-mode))
|
2016-06-04 03:29:59 +00:00
|
|
|
(spacemacs/declare-prefix "Ci" "colors-identifiers")
|
|
|
|
(spacemacs|add-toggle color-identifiers-mode
|
|
|
|
:status color-identifiers-mode
|
|
|
|
:on (progn
|
|
|
|
(when (bound-and-true-p rainbow-identifiers-mode)
|
|
|
|
(rainbow-identifiers-mode -1))
|
|
|
|
(color-identifiers-mode))
|
|
|
|
:off (color-identifiers-mode -1)
|
|
|
|
:documentation "Colorize variables."
|
|
|
|
:evil-leader "tCv")
|
2015-09-08 07:40:23 +00:00
|
|
|
(spacemacs|add-toggle global-color-identifiers-mode
|
|
|
|
:status global-color-identifiers-mode
|
2016-06-04 03:29:59 +00:00
|
|
|
:on (progn
|
|
|
|
(when (bound-and-true-p global-rainbow-identifiers-mode)
|
|
|
|
(global-rainbow-identifiers-mode -1))
|
|
|
|
(global-color-identifiers-mode))
|
2015-09-08 07:40:23 +00:00
|
|
|
:off (global-color-identifiers-mode -1)
|
2016-06-04 03:29:59 +00:00
|
|
|
:documentation "Colorize variables globally."
|
|
|
|
:evil-leader "tC C-v"))
|
|
|
|
:config (spacemacs|hide-lighter color-identifiers-mode)))
|
2015-09-08 07:40:23 +00:00
|
|
|
|
2014-12-18 05:12:04 +00:00
|
|
|
(defun colors/init-rainbow-identifiers ()
|
|
|
|
(use-package rainbow-identifiers
|
2016-06-04 03:29:59 +00:00
|
|
|
:commands (global-rainbow-identifiers-mode
|
|
|
|
rainbow-identifiers-mode)
|
2014-12-18 05:12:04 +00:00
|
|
|
:init
|
2015-03-31 10:49:40 +00:00
|
|
|
(progn
|
2014-12-18 05:12:04 +00:00
|
|
|
(setq rainbow-identifiers-choose-face-function 'rainbow-identifiers-cie-l*a*b*-choose-face
|
2016-12-07 23:10:56 +00:00
|
|
|
;; defaults to use before we've loaded per-theme settings
|
|
|
|
rainbow-identifiers-cie-l*a*b*-saturation colors-default-rainbow-identifiers-sat
|
|
|
|
rainbow-identifiers-cie-l*a*b*-lightness colors-default-rainbow-identifiers-light
|
2014-12-18 05:12:04 +00:00
|
|
|
;; override theme faces
|
|
|
|
rainbow-identifiers-faces-to-override '(highlight-quoted-symbol
|
2015-04-19 02:52:23 +00:00
|
|
|
font-lock-keyword-face
|
|
|
|
font-lock-function-name-face
|
2014-12-18 05:12:04 +00:00
|
|
|
font-lock-variable-name-face))
|
2016-06-04 03:29:59 +00:00
|
|
|
(defadvice spacemacs/post-theme-init (after colors/post-theme-init activate)
|
|
|
|
"Adjust lightness and brightness of rainbow-identifiers on post theme init."
|
|
|
|
(colors//tweak-theme-colors spacemacs--cur-theme))
|
|
|
|
;; key bindings
|
2016-04-03 04:12:28 +00:00
|
|
|
(spacemacs/declare-prefix "Ci" "colors-identifiers")
|
2016-06-04 03:29:59 +00:00
|
|
|
(spacemacs|add-toggle rainbow-identifier
|
|
|
|
:status rainbow-identifiers-mode
|
|
|
|
:on (progn
|
|
|
|
(when (bound-and-true-p color-identifiers-mode)
|
|
|
|
(color-identifiers-mode -1))
|
|
|
|
(rainbow-identifiers-mode))
|
|
|
|
:off (rainbow-identifiers-mode -1)
|
|
|
|
:documentation "Colorize all identifiers."
|
|
|
|
:evil-leader "tCa")
|
|
|
|
(with-eval-after-load 'rainbow-identifiers
|
|
|
|
(define-global-minor-mode global-rainbow-identifiers-mode
|
|
|
|
rainbow-identifiers-mode colors//rainbow-identifiers-mode-maybe))
|
|
|
|
(spacemacs|add-toggle global-rainbow-identifiers-mode
|
|
|
|
:status global-rainbow-identifiers-mode
|
|
|
|
:on (progn
|
|
|
|
(when (bound-and-true-p global-color-identifiers-mode)
|
|
|
|
(global-color-identifiers-mode -1))
|
|
|
|
(global-rainbow-identifiers-mode))
|
|
|
|
:off (global-rainbow-identifiers-mode -1)
|
2015-07-25 13:14:53 +00:00
|
|
|
:documentation "Colorize identifiers globally."
|
2016-06-04 03:29:59 +00:00
|
|
|
:evil-leader "tC C-a")
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys "Cis" 'colors/start-change-color-saturation)
|
2016-06-04 03:29:59 +00:00
|
|
|
(spacemacs/set-leader-keys "Cil" 'colors/start-change-color-lightness)
|
|
|
|
;; tweak colors of current theme
|
|
|
|
(colors//tweak-theme-colors spacemacs--cur-theme)
|
|
|
|
(when (eq 'all colors-colorize-identifiers)
|
|
|
|
(global-rainbow-identifiers-mode)))))
|
2015-01-24 05:03:40 +00:00
|
|
|
|
|
|
|
(defun colors/init-rainbow-mode ()
|
|
|
|
(use-package rainbow-mode
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-11-18 00:38:05 +00:00
|
|
|
:init (spacemacs/set-leader-keys "tCc" 'rainbow-mode)
|
2015-01-24 05:03:40 +00:00
|
|
|
:config (spacemacs|hide-lighter rainbow-mode)))
|