Home

Awesome

<table><tbody align='center'> <tr> <td colspan='8'><h1>snow</h1> <img src="https://github.com/nightsense/snow/raw/master/images/header.jpg" /> <h4>a blue-tinted winter vimscape</h4> </td> </tr> <tr> <td colspan='4' width='50%'> <br> <img alt="screenshot of the snow vim theme, light version" src="https://github.com/nightsense/snow/raw/master/images/screenshot-light.png" width='420' /> <br><br> </td> <td colspan='4' width='50%'> <br> <img alt="screenshot of the snow vim theme, dark version" src="https://github.com/nightsense/snow/raw/master/images/screenshot-dark.png" width='420' /> <br><br> </td> </tr> <tr> <td width='202'><code>Normal bg</code></td> <td><img src='http://www.colorhexa.com/fbffff.png' height='24' width='39'></td> <td><img src='http://www.colorhexa.com/ae5865.png' height='24' width='39'></td> <td colspan='2'><code>Identifier</code></td> <td><img src='http://www.colorhexa.com/be868c.png' height='24' width='39'></td> <td><img src='http://www.colorhexa.com/2c2d30.png' height='24' width='39'></td> <td width='202'><code>Normal bg</code></td> </tr> <tr></tr> <tr> <td><code>ColorColumn</code></td> <td><img src='http://www.colorhexa.com/e5ebf1.png' height='24' width='39'></td> <td><img src='http://www.colorhexa.com/906c33.png' height='24' width='39'></td> <td colspan='2'><code>Special</code></td> <td><img src='http://www.colorhexa.com/ab916d.png' height='24' width='39'></td> <td><img src='http://www.colorhexa.com/363a3e.png' height='24' width='39'></td> <td><code>ColorColumn</code></td> </tr> <tr></tr> <tr> <td><code>MatchParen</code></td> <td><img src='http://www.colorhexa.com/afb7c0.png' height='24' width='39'></td> <td><img src='http://www.colorhexa.com/4d7f43.png' height='24' width='39'></td> <td colspan='2'><code>Statement</code></td> <td><img src='http://www.colorhexa.com/7f9d77.png' height='24' width='39'></td> <td><img src='http://www.colorhexa.com/535c65.png' height='24' width='39'></td> <td><code>MatchParen</code></td> </tr> <tr></tr> <tr> <td><code>Comment</code></td> <td><img src='http://www.colorhexa.com/6d7782.png' height='24' width='39'></td> <td><img src='http://www.colorhexa.com/008483.png' height='24' width='39'></td> <td colspan='2'><code>PreProc</code></td> <td><img src='http://www.colorhexa.com/5da19f.png' height='24' width='39'></td> <td><img src='http://www.colorhexa.com/8c95a0.png' height='24' width='39'></td> <td><code>Comment</code></td> </tr> <tr></tr> <tr> <td><code>Normal fg</code></td> <td><img src='http://www.colorhexa.com/535c65.png' height='24' width='39'></td> <td><img src='http://www.colorhexa.com/2b7ab2.png' height='24' width='39'></td> <td colspan='2'><code>Constant</code></td> <td><img src='http://www.colorhexa.com/759abd.png' height='24' width='39'></td> <td><img src='http://www.colorhexa.com/afb7c0.png' height='24' width='39'></td> <td><code>Normal fg</code></td> </tr> <tr></tr> <tr> <td><code>Cursor</code></td> <td><img src='http://www.colorhexa.com/434951.png' height='24' width='39'></td> <td><img src='http://www.colorhexa.com/8f63a2.png' height='24' width='39'></td> <td width='202' colspan='2'><code>Type</code></td> <td><img src='http://www.colorhexa.com/a88cb3.png' height='24' width='39'></td> <td><img src='http://www.colorhexa.com/cbd2d9.png' height='24' width='39'></td> <td><code>Cursor</code></td> </tr> <tr></tr> <tr> <td><code>Search</code></td> <td><img src='http://www.colorhexa.com/e5bb7e.png' height='24' width='39'></td> <td> <img src='http://www.colorhexa.com/bc4d61.png' height='2' width='6'> <img src='http://www.colorhexa.com/007cc3.png' height='2' width='6'> <img src='http://www.colorhexa.com/008787.png' height='2' width='6'> <img src='http://www.colorhexa.com/965dae.png' height='2' width='6'> </td> <td width='202' colspan='2'><code>Spell</code></td> <td> <img src='http://www.colorhexa.com/df969e.png' height='2' width='6'> <img src='http://www.colorhexa.com/7fb0df.png' height='2' width='6'> <img src='http://www.colorhexa.com/5eb9b7.png' height='2' width='6'> <img src='http://www.colorhexa.com/c39dd1.png' height='2' width='6'> </td> <td><img src='http://www.colorhexa.com/ab916d.png' height='24' width='39'></td> <td><code>Search</code></td> </tr> <tr></tr> <tr> <td colspan='8'> <br>

because <img height="16" src='https://github.com/nightsense/snow/raw/master/images/red.png' /> red is the color of life, reddish text is for...

    <img src="http://www.colorhexa.com/ae5865.png" height='12' width='12'> names, which give life <img height="9" src='https://github.com/nightsense/snow/raw/master/images/name.png' /> to abstractions (like variables and functions)

    <img src="http://www.colorhexa.com/8f63a2.png" height='12' width='12'> types ("meta-names" <img height="15" src='https://github.com/nightsense/snow/raw/master/images/type.png' />), such as variable type (int, char...) or storage class (static, register...)

<br>

because <img height="16" src='https://github.com/nightsense/snow/raw/master/images/gold.png' /> gold is a special color, gold text is for...

    <img src="http://www.colorhexa.com/906c33.png" height='12' width='12'> specials (elements that unlock <img height="16" src='https://github.com/nightsense/snow/raw/master/images/special.png' /> special features), such as delimiters and debug statements

<br>

because <img height="15" src='https://github.com/nightsense/snow/raw/master/images/green.png' /> green is the color of proceeding with action, greenish text is for...

    <img src="http://www.colorhexa.com/4d7f43.png" height='12' width='12'> statements (the magic <img height="11" src='https://github.com/nightsense/snow/raw/master/images/statement.png' /> "action words" of code), such as conditions (if, then...) or loops (for, do...)

    <img src="http://www.colorhexa.com/008483.png" height='12' width='12'> meta-statements ("meta-actions", or "meta-magic" <img height="16" src='https://github.com/nightsense/snow/raw/master/images/meta-statement.png' />), such as macros and "include module" statements

<br>

because <img height="14" src='https://github.com/nightsense/snow/raw/master/images/blue.png' /> blue is the calm color of sea and sky, evoking enduring constancy, blue text is for...

    <img src="http://www.colorhexa.com/2b7ab2.png" height='12' width='12'> constants (values that are fixed <img height="22" src='https://github.com/nightsense/snow/raw/master/images/constant.png' /> in place), such as booleans, integers, and strings

<br>

primary colors of the standard additive model (<img src="http://www.colorhexa.com/ae5865.png" height='9' width='6'> red, <img src="http://www.colorhexa.com/4d7f43.png" height='9' width='6'> green, <img src="http://www.colorhexa.com/2b7ab2.png" height='9' width='6'> blue) are thus assigned to "regular" elements,<br> while secondary colors (<img src="http://www.colorhexa.com/8f63a2.png" height='9' width='6'> magenta, <img src="http://www.colorhexa.com/906c33.png" height='9' width='6'> yellow, <img src="http://www.colorhexa.com/008483.png" height='9' width='6'> cyan) are assigned to "elevated" (meta/special) elements

<br>

This logic is replicated in the <a href="https://github.com/nightsense/cosmic_latte">cosmic_latte</a> theme.

</td> </tr> </tbody></table>

installation

If you don’t have a preferred plugin management method, consider vim-plug, which can be installed (on *nix systems) with:

curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

Having installed vim-plug, snow can be installed by adding the following to the top of your vimrc...

call plug#begin('~/.vim/plugged')
Plug 'nightsense/snow'
call plug#end()

...then restarting vim, followed by running :PlugUpdate (at the vim command line).

activation

For a snow day, add the following to vimrc:

set background=light
colorscheme snow

For a snowy evening:

set background=dark
colorscheme snow

To set the background automatically based on the time at which vim is launched:

if strftime('%H') >= 7 && strftime('%H') < 19
  set background=light
else
  set background=dark
endif
colorscheme snow

...which activates the light version of snow during the day (defined here as 7AM-7PM), dark version at night.

Be sure to set colorscheme after background, otherwise some theme colors may not be applied.

status line themes

snow comes with themes for airline and lightline, which can be activated with the following vimrc code:

<table><tbody align='center'> <tr> <td width='88'></td> <td width='340'><strong>airline</strong></td> <td width='470'><strong>lightline</strong></td> </tr> <tr> <td><strong>light</strong></td> <td><code>let g:airline_theme='snow_light'</code></td> <td><code>let g:lightline = { 'colorscheme': 'snow_light' }</code></td> </tr> <tr> <td><strong>dark</strong></td> <td><code>let g:airline_theme='snow_dark'</code></td> <td><code>let g:lightline = { 'colorscheme': 'snow_dark' }</code></td> </tr> </tbody></table>

Status line themes can be added to the time-based snippet above:

if strftime('%H') >= 7 && strftime('%H') < 19
  set background=light
  let g:lightline = { 'colorscheme': 'snow_light' }
else
  set background=dark
  let g:lightline = { 'colorscheme': 'snow_dark' }
endif
colorscheme snow

terminal vim

colors

Terminals/multiplexers with true-color support can display the exact colors of the snow theme.

In most cases, the only vimrc setting you need is:

set termguicolors

In some cases you'll also need (see :h xterm-true-color for explanation):

let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"

If termguicolors is not set, terminal vim will fall back to a rough approximation of snow, drawing from the terminal emulator's 256-color palette (if present).

The fallback version of snow defines colors using numbers in the range 0-255 (as opposed to 6-character hex codes, whose range of 2<sup>24</sup> values is known as "true color"). Terminal emulators with 256-color support understand this encoding, though they vary in the exact color associated with each number. The closest thing to a standard 256-color *nix palette is that used by xterm, the default X Windows terminal emulator.

cursor shape

To set mode-specific cursor shapes in terminal vim, see the Vim Tips Wiki.

For instance, to set cursor shapes in vte-compatible terminals, you could add to vimrc:

let &t_SI = "\<Esc>[6 q"
let &t_SR = "\<Esc>[4 q"
let &t_EI = "\<Esc>[2 q"

...which sets the cursor to a vertical line for insert mode, underline for replace mode, and block for normal mode.

shell

colors

Many terminal emulators can be themed by sourcing the color-setting shell scripts included with snow. The path to these scripts will depend on your plugin management method.

For instance, if you use vim-plug and want to apply the dark snow theme to your bash or zsh shell, add the following to ~/.bashrc or ~/.zshrc:

[ -n "$PS1" ] && sh ~/.vim/plugged/snow/shell/snow_dark.sh

Or for the fish shell, add to ~/.config/fish/config.fish:

if status --is-interactive
  sh ~/.vim/plugged/snow/shell/snow_dark.sh
end

If you use vundle, replace plugged in the above paths with bundle.

Replace dark with light for the light theme.

dircolors

The text highlighting used by the ls command (for distinguishing file types) can be themed by sourcing the "dircolors" file included with snow. The path to this file will depend on your plugin management method.

For instance, if you use vim-plug and want to apply the snow dircolors to your bash or zsh shell, add the following to ~/.bashrc or ~/.zshrc:

eval `dircolors ~/.vim/plugged/snow/shell/dircolors`

Or for the fish shell, add to ~/.config/fish/config.fish:

eval (dircolors -c ~/.vim/plugged/snow/shell/dircolors)

If you use vundle, replace plugged in the above paths with bundle.

fish syntax

Again, the script path will depend on your plugin management method.

For the dark theme in a vim-plug setup, add to ~/.config/fish/config.fish:

source ~/.vim/plugged/snow/shell/snow_dark.fish

ports

building from source

From the templates directory, run: fish generate.fish.

Dependencies:


<a href='https://opensource.org/licenses/MIT'><img src='https://img.shields.io/badge/license-MIT-a31f34.svg?style=flat-square' /></a>     <a href='https://www.python.org/'><img src='https://img.shields.io/badge/made%20with-Python-306998.svg?style=flat-square' /></a>     <a href='https://fishshell.com/'><img src='https://img.shields.io/badge/made%20with-fish-d2232a.svg?style=flat-square' /></a>     <a href='https://github.com/lifepillar/vim-colortemplate'><img src='https://img.shields.io/badge/made%20with-Colortemplate-007f00.svg?style=flat-square' /></a>     <a href='https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html'><img src='https://img.shields.io/badge/meets%20standard-4.5%3A1%20readability%20contrast-005a9c.svg?style=flat-square' /></a>

<h6>The 4.5:1 <a href='https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html#visual-audio-contrast-contrast-73-head'>W3C contrast ratio standard</a> for readability is met by all text/background combinations, with the exception of some transient highlighting (e.g. cursorline/column), which nonetheless well exceeds the minimal ISO 3:1 standard.</h6> <h6>image credit: snowflake macrophoto by <a href='https://www.flickr.com/photos/chaoticmind75/39326731084/'>Olga & Alexey (CC BY-NC 2.0)</h6>