/stellarized

paint vim with the stars

Primary LanguageVim script

stellarized

paint vim with the stars


screenshot of the stellarized vim theme, light version

screenshot of the stellarized vim theme, dark version
The solarized theme, inspired by reading a book under
a shady tree on a sunny day, features a base palette
of dark green-blue and bright orange-yellow.
The stellarized theme takes this basic idea and shifts
the base hues to reflect the colours of the stars.
Specifically, dark base colors are shifted bluewise (to
the approximate "hot star hue"), while light base colors
are shifted orangewise (to the "cold star hue").
stellarized is a special adaptation of snow.

installation

If you don’t have a preferred plugin helper, consider trying vim-plug, which can be installed with:

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

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

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

...then reloading vimrc (by running :so % at the vim command line, or by restarting vim), followed by :PlugUpdate.

activation

For a sunny day, add the following to vimrc:

colorscheme stellarized
set background=light

For a starry night:

colorscheme stellarized
set background=dark

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

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

...which activates the light version of stellarized during the day (7AM-7PM), dark version at night.

The night-and-day plugin can switch themes and/or backgrounds automatically, using absolute or sun-relative time.

status line themes

stellarized comes with light and dark themes for airline and lightline.

For instance, to activate the airline theme with dark background:

let g:airline_theme='stellarized_dark'

Or the lightline theme with light background:

let g:lightline = { 'colorscheme': 'stellarized_light' }

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

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

terminal vim

colors

stellarized should work in 256-color and true-color terminals. You may need the following in vimrc:

set termguicolors

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 (like urxvt), 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.


released under the MIT license
generated with Colortemplate
night sky photo by ESO/S. Brunier (CC BY 4.0)