From 3b365071784e8c680d87254d8cf5fe1d9e04fe6b Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Tue, 27 Jan 2015 00:29:31 -0500 Subject: [PATCH] Move back rainbow-delimiters to spacemacs layer Also always install rainbow-identifiers --- contrib/colors/README.md | 14 -------------- contrib/colors/config.el | 3 +-- contrib/colors/packages.el | 14 ++------------ spacemacs/config.el | 1 + spacemacs/packages.el | 9 +++++++++ 5 files changed, 13 insertions(+), 28 deletions(-) diff --git a/contrib/colors/README.md b/contrib/colors/README.md index 892d6b140..7d05b6cc6 100644 --- a/contrib/colors/README.md +++ b/contrib/colors/README.md @@ -11,7 +11,6 @@ - [Enable rainbow-identifiers](#enable-rainbow-identifiers) - [Key bindings](#key-bindings) - [Rainbow Identifiers](#rainbow-identifiers) - - [Rainbow delimiters](#rainbow-delimiters) - [Rainbow Mode](#rainbow-mode) @@ -20,16 +19,12 @@ This layer colors your life with: - [rainbow identifiers][] -- [rainbow delimiters][] - [rainbow mode][] [rainbow identifiers][] mode will colorize each variables and functions with an almost unique color. The keywords and the declaration of function colors are disabled in order to make the colorized variables and functions stand out. -[rainbow delimiters][] highlights delimiters such as parentheses, brackets or -braces according to their depth. - [rainbow mode][] displays strings representing colors with the color they represent as background. @@ -82,14 +77,6 @@ Key Binding | Description `=` | reset the `saturation` or `lightness` Any other key | leave the change mini-mode -### Rainbow delimiters - -`rainbow-delimiters` mode can be toggled on and off with: - - t C d - -Note that the toggle is local to the current buffer. - ### Rainbow Mode ![rainbow_mode](img/rainbow-mode.png) @@ -101,6 +88,5 @@ Note that the toggle is local to the current buffer. Note that the toggle is local to the current buffer. [rainbow identifiers]: https://github.com/Fanael/rainbow-identifiers -[rainbow delimiters]: https://github.com/Fanael/rainbow-delimiters [rainbow mode]: https://julien.danjou.info/projects/emacs-packages diff --git a/contrib/colors/config.el b/contrib/colors/config.el index a6af6c872..57e5e30fe 100644 --- a/contrib/colors/config.el +++ b/contrib/colors/config.el @@ -21,8 +21,7 @@ ;; Command prefixes -(setq colors/key-binding-prefixes '(("C" . "colors") - ("tC" . "toggles-colors"))) +(setq colors/key-binding-prefixes '(("C" . "colors"))) (when colors-enable-rainbow-identifiers (push (cons "Ci" "colors-identifiers") colors/key-binding-prefixes)) (mapc (lambda (x) (spacemacs/declare-prefix (car x) (cdr x))) diff --git a/contrib/colors/packages.el b/contrib/colors/packages.el index 6d3d4940b..ad6235ded 100644 --- a/contrib/colors/packages.el +++ b/contrib/colors/packages.el @@ -14,30 +14,20 @@ '( ;; not working well for now ;; rainbow-blocks - rainbow-delimiters + rainbow-identifiers rainbow-mode ) "List of all packages to install and/or initialize. Built-in packages which require an initialization must be listed explicitly in the list.") -(when colors-enable-rainbow-identifiers - (push 'rainbow-identifiers colors-packages)) - (defun colors/init-rainbow-blocks () (use-package rainbow-blocks :disabled t :init (add-hook 'emacs-lisp-mode-hook 'rainbow-blocks-mode))) -(defun colors/init-rainbow-delimiters () - (use-package rainbow-delimiters - :defer t - :init - (progn - (evil-leader/set-key "tCd" 'rainbow-delimiters-mode) - (add-to-hooks 'rainbow-delimiters-mode '(prog-mode-hook))))) - (defun colors/init-rainbow-identifiers () (use-package rainbow-identifiers + :if colors-enable-rainbow-identifiers :commands rainbow-identifiers-mode :init (progn diff --git a/spacemacs/config.el b/spacemacs/config.el index 17fb9ccdc..eaf4b36f5 100644 --- a/spacemacs/config.el +++ b/spacemacs/config.el @@ -35,6 +35,7 @@ ("s" . "search/symbol") ("S" . "spelling") ("t" . "toggles") + ("tC" . "toggles-colors") ("tm" . "toggles-modeline") ("T" . "themes") ("w" . "windows") diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 3333addbf..714cc7dff 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -97,6 +97,7 @@ popwin powerline projectile + rainbow-delimiters rcirc rcirc-color recentf @@ -1854,6 +1855,14 @@ which require an initialization must be listed explicitly in the list.") (projectile-global-mode) (spacemacs|hide-lighter projectile-mode)))) +(defun spacemacs/init-rainbow-delimiters () + (use-package rainbow-delimiters + :defer t + :init + (progn + (evil-leader/set-key "tCd" 'rainbow-delimiters-mode) + (add-to-hooks 'rainbow-delimiters-mode '(prog-mode-hook))))) + (defun spacemacs/init-rcirc () (use-package rcirc :commands irc