|
|
The solarized theme, inspired by reading a book under |
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
.
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.
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
stellarized should work in 256-color and true-color terminals. You may need the following in vimrc:
set termguicolors
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.