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/colors
2016-01-31 23:04:47 -05:00
..
img
local/nyan-mode Deprecation of extensions and <pkg>-excluded-packages variables 2016-01-17 22:06:04 -05:00
config.el Clean copyrights and update for year 2016 2016-01-11 21:42:17 -05:00
packages.el Deprecation of extensions and <pkg>-excluded-packages variables 2016-01-17 22:06:04 -05:00
README.org Change all references of micro-state in codebase to transient-state 2016-01-31 23:04:47 -05:00

Colors layer

/TakeV/spacemacs/media/commit/6f09ab5c07f3a40220cc1e0324aba1db4483566c/layers/colors/img/rainbow_dash.png

Description

This layer colors your life with:

  • 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 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.

Enable rainbow-identifiers

To enable the package rainbow-identifiers set the variable colors-enable-rainbow-identifiers to t:

  (setq-default dotspacemacs-configuration-layers '(
    (colors :variables colors-enable-rainbow-identifiers t)))

Saturation and lightness of identifiers 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).

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.

Rainbow Identifiers

/TakeV/spacemacs/media/commit/6f09ab5c07f3a40220cc1e0324aba1db4483566c/layers/colors/img/theme-tweaks-python.png

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

<SPC> t C i

Note that the toggle is local to the current buffer.

The saturation and lightness of identifier colors can be adjusted live 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/6f09ab5c07f3a40220cc1e0324aba1db4483566c/layers/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.