sponsor Vim development Vim logo Vim Book Ad

colorschemer : Vim colorschemer

 script karma  Rating 21/8, Downloaded by 2028  Comments, bugs, improvements  Vim wiki

created by
richard emberson
script type
The ColorSchemer is a Forms library based utility.
The Forms library  can be found at

The ColorSchemer consist of three parts:
  Basic utilty and core data,
  Cterm distilled color scheme data files and
  Gui distilled color scheme data files.

The core subset of colorschemer does not require either the
cterm or gui data files. It consist of the Distill code
found in 'distill.vim' and the Viewer code found in 'viewer.vim'.
In addition, it has a collection of some 687 third-party color
scheme files.

The Distiller will take one or more color scheme files and
produce 'distilled' versions of those color schema.
The processing does the following:
*  It eliminates those highlight group declarations that are redundant,
*  It eliminates those group attributes that are redundant,
*  Generates a standard comment header and initial VimL code:

        set background= 'light' or 'dark'
        hi clear

        if exists("syntax_on")
            syntax reset

        let g:colors_name = expand("<sfile>:t:r")

*  Output highlight group definitions targeted for specific GVim and Vim

        if has("gui_running")
            " highlights for GVim
        elseif &t_Co == 256
            " highlights for 256 color Xterm Vim
        elseif &t_Co == 88
            " highlights for 88 urvxt color Vim
        elseif &t_Co == 16
            " highlights for 16 color Xterm Vim
        else " &t_Co == 8
            " highlights for 8 color Xterm Vim

*  It eliminates redundant link definitions,
*  The background color set depends primarily on the Normal background value and not what the color scheme file says (because, they sometimes lie).
*  When appropriate generates both a 'dark' and 'light' version of the same base color scheme file.

One of the Distill functions takes all of the 687 third-party color
schema and distills them. It should be noted that slightly different
results are achieved when executing the Distill code in GVim versus
Vim (some color schemes only have definitions for GVim or Vim).

Also part of the core distribution that allows one to very easily
view different file-types applying different color schemes.
Far easier and quicker than other ways.
The viewer can be invoked through the mapping:


The Cterm distribution contains the set of distilled files generated
by the distill script by using Vim. A user can simply download this
set if they do not want to generate them themselves using distill.vim.

The Gui distribution contains the set of distilled files generated
by the distill script by using GVim. A user can simply download this
set if they do not want to generate them themselves using distill.vim.

The release version can also be found at:

Examples images of the color schemer viewer can be found at:

install details
To get the Basic utilty and core data:
  Download the colorschemer_core.zip file

To get the Cterm distilled color scheme files
  Download the colorschemer_cterm.zip file

To get the Gui distilled color scheme files
  Download the colorschemer_gui.zip file

A zip snapshot of the {ColorSchemer} library can be downloaded
from www.vim.org (http://www.vim.org/scripts/script.php?script_id=4240)

In your Vim home, normally $HOME/.vim in Unix, unzip the file:

    # cd $HOME/.vim
    # unzip colorschemer_core.zip
    # unzip colorschemer_cterm.zip       -- optional
    # unzip colorschemer_gui.zip         -- optional

On a Windows system, vim home is normally $HOME/vimfiles.

    TODO how to unpack on Windows?

{ColorSchemer} is also available via
One can download a release from github and extract content.

If as a developer, one wants fixes as they appear, one can clone the
github {ColorSchemer} repository and, as updates appear, copy the files
over to you Vim home location.

Vim has a number of third-party plugin managers. If you are using one
you can configure it to automatically download and install {ColorSchemer}.

After unpacking the ColorSchemer directory layout should look like:

            " generate distilled color scheme files
            " view test files with their syntax allowing for
            " very quick toggling through color schemes
        " data that persists between invocations of a plugin
            " colorschemer data
              " source Vim color scheme files (some 688 of them!)
              " target directory for files generated by distill.vim
              " generated using distill.vim in Vim
              " optional part of the colorschemer_cterm.zip
              " generated using distill.vim in GVim
              " optional part of the colorschemer_gui.zip
              " test source files (c, pl, java, scala, tex, html)
              " users can add addition ones

Intalling with vim-addon-manager (VAM)

For more information about vim-addon-manager, see [vim-addon-manager](https://github.com/MarcWeber/vim-addon-manager) and [Vim-addon-manager getting started](https://github.com/MarcWeber/vim-addon-manager/blob/master/doc/vim-addon-manager-getting-started.txt)

In your .vimrc, add self as shown below:

    fun SetupVAM()


      let g:vim_addon_manager = {}
      let g:vim_addon_manager.plugin_sources = {}


      let g:vim_addon_manager.plugin_sources['self'] = {'type': 'git', 'url': 'git://github.com/megaannum/self'}
      let g:vim_addon_manager.plugin_sources['forms'] = {'type': 'git', 'url': 'git://github.com/megaannum/forms'}
      let g:vim_addon_manager.plugin_sources['colorschemer'] = {'type': 'git', 'url': 'git://github.com/megaannum/colorschemer'}

      let plugins = [
        \ 'self',
        \ 'forms',
        \ 'colorschemer'
        \ ]

      call vam#ActivateAddons(plugins,{'auto_install' : 0})


    call SetupVAM()

Now start Vim. You will be asked by vim-addon-manager
if you would like to download and install the self plugin (no dependencies).

Installing with pathogen:
I do not use pathogen. An example usage would be welcome.


rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
colorschemer_gui.zip 1.2b 2012-10-01 7.3 richard emberson Gui Data Initial Release
colorschemer_cterm.zip 1.2a 2012-10-01 7.3 richard emberson Cterm data Initial Release
colorschemer_core.zip 1.2 2012-10-01 7.3 richard emberson Core Initial Release
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
Vim at Github