This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+themes/colors
2016-09-23 10:50:46 +03:00
..
img layers directory: create new categories 2016-03-23 21:39:43 -04:00
local/nyan-mode Format documenation files with doc-fmt tool 2016-04-12 23:31:38 -04:00
config.el fix typo packges -> packages 2016-09-23 10:50:46 +03:00
funcs.el rainbow-identifiers: do not overwrite theme values 2016-06-09 22:58:31 -04:00
packages.el colors: remove colors-enable-rainbow-identifiers and new layer variable colors-colorize-identifiers 2016-06-03 23:29:59 -04:00
README.org colors: remove colors-enable-rainbow-identifiers and new layer variable colors-colorize-identifiers 2016-06-03 23:29:59 -04:00

Colors layer

/TakeV/spacemacs/media/commit/779072a6516b0d6fef68cdf28e763ab3a630815b/layers/+themes/colors/img/rainbow_dash.png

Description

This layer colors your life with:

  • rainbow identifiers mode will colorize all identifiers (christmas tree mode :-)) with an almost unique color.
  • color-identifiers mode will colorize only identifiers recognized as variables.
  • rainbow mode displays strings representing colors with the color they represent as background.
  • nyan mode display a Nyan cat progress bar in the mode-line.

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add colors to the existing dotspacemacs-configuration-layers list in this file.

Configuration

Colorize identifiers

To colorize some identifiers by default in programming language buffers, set the layer variables colors-colorize-identifiers to either variables or all. variables will colorize only words recognized as variables, all will colorize all the words.

  (setq-default dotspacemacs-configuration-layers '(
    (colors :variables colors-colorize-identifiers 'all)))

When using the value all the Saturation and lightness of can be set per theme by adding an entry in the variable colors-theme-identifiers-sat&light. This is an alist where the key is a theme symbol and the value is a pair (saturation lightness).

For now saturation and lightness are not supported with the variables value.

Example:

  (push '(mytheme . (50 50)) colors-theme-identifiers-sat&light)

Enable Nyan cat

To enable the package nyan-mode set the variable colors-enable-nyan-cat-progress-bar to t:

  (setq-default dotspacemacs-configuration-layers '(
    (colors :variables colors-enable-nyan-cat-progress-bar t)))

It may be handy to enable it only in a GUI, you can do it by using a quasi-quoted list:

  (setq-default dotspacemacs-configuration-layers
    =((colors :variables
              colors-enable-nyan-cat-progress-bar ,(display-graphic-p))))

Key bindings

The prefix associated with colors is C.

Colorize Identifiers

Key Binding Description
SPC C a colorize all idendifiers in current buffer
SPC C C-a globally colorize all idendifiers and all subsequent buffers
SPC C v colorize all variables only in current buffer
SPC C C-v globally colorize all variables only and all subsequent buffers

The saturation and lightness of identifier colors can be adjusted live when colorizing all the identifiers with the transient-state:

Key Binding Description
SPC C i s initiate change saturation mini-mode
SPC C i l initiate change lightness mini-mode
+ increase the saturation or lightness
- decrease the saturation or lightness
= reset the saturation or lightness
Any other key leave the change mini-mode

Rainbow Mode

/TakeV/spacemacs/media/commit/779072a6516b0d6fef68cdf28e763ab3a630815b/layers/+themes/colors/img/rainbow-mode.png

rainbow-mode mode can be toggled on and off with:

SPC t C c

Nyan Mode

nyan-mode mode can be toggled on and off with:

SPC t m n

Note that the toggle is local to the current buffer.