Solarized 8: True Colors
This is yet another Solarized theme for Vim. It places itself half way between the original Solarized and the Flattened variant. It removes only some of the bullshit. The color palette is exactly the same as in Solarized, of course, although some highlight groups are defined slightly differently (for instance, I have tried to avoid red on blue).
The main reason for the existence of this project is that the original Solarized
theme does not define
guibg in terminal Vim, making it unsuitable
for versions of Vim supporting true-color terminals. Instead, this color scheme
works out of the box if you use:
- Vim ≥7.4.1799 with
and a true-color enabled terminal (e.g., iTerm2). Solarized 8 also works in MacVim, gVim, etc…: no configuration is needed.
For terminals not supporting true colors, your 16 terminal ASCII colors must be set to the Solarized palette. The ugly degraded 256-color variant of the original Solarized has been removed from Solarized 8.
In NeoVim, Solarized 8 also defines the color palette for the terminal
emulator, as well as
colors for the
TermCursorNC highlight groups.
If your Vim supports packages (
echo has('packages') prints
1), I strongly
recommend that you use them. Just clone this repo inside
git clone https://github.com/lifepillar/vim-solarized8.git \ ~/.vim/pack/themes/opt/solarized8
Otherwise, use your favourite installation method.
There are actually 8 optimized color schemes:
solarized8_light: the default Solarized theme;
solarized8_light_low: low-contrast variant;
solarized8_light_high: high-contrast variant;
solarized8_light_flat: “flat” variant (not present in the original Solarized, see screenshots above).
To use any of them, put a line like the following in your
Note: if you use Vim packages, there is no need to
The following options are inherited from Solarized:
g:solarized_visibility: one of
g:solarized_diffmode: one of
g:solarized_termtrans: make terminal background transparent if set to
The following options were not available in the original Solarized:
g:solarized_statusline: one of
g:solarized_term_italics: set to
1if your terminal supports italics (default is
These options may be used with any
Hey, I do not get the right colors when running Vim inside tmux or in my favourite true-color enabled terminal!
Try putting this in your
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum" let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
:h xterm-true-color for the details.
If you want to quickly toggle between dark and light background, you may define a mapping like the following:
nnoremap <leader>B :<c-u>exe "colors" (g:colors_name =~# "dark" \ ? substitute(g:colors_name, 'dark', 'light', '') \ : substitute(g:colors_name, 'light', 'dark', '') \ )<cr>
To tune the contrast level you may use the following snippet:
fun! Solarized8Contrast(delta) let l:schemes = map(["_low", "_flat", "", "_high"], '"solarized8_".(&background).v:val') exe "colors" l:schemes[((a:delta+index(l:schemes, g:colors_name)) % 4 + 4) % 4] endf nmap <leader>- :<c-u>call Solarized8Contrast(-v:count1)<cr> nmap <leader>+ :<c-u>call Solarized8Contrast(+v:count1)<cr>
If you want to tweak the colors yourself, edit
it to recreate the color schemes.