In order to address
https://github.com/lifepillar/vim-solarized8/issues/14
and further concerns in
https://github.com/lifepillar/vim-solarized8/issues/15
in the previous commit and in this one I have updated Cursor and
MatchParen highlighting, respectively.
The current colors are based on the following considerations:
1. The Solarized palette has only two "whites": the ligther is used in
all variants but "low", which uses the darker.
2. Matching parentheses should be distinguishable even if bold face is
disabled.
3. The cursor and matching parentheses should be easily distinguishable
even when 'cursorline' is on. Before the recent commits this was not
the case.
4. MatchParen's background may be set to NONE in the "low" and "flat"
variants, because CursorLine uses underline. It should be set to
something different in the other two variants, otherwise it may
become impossible to see a matching character.
5. MatchParen's foreground color shouldn't be red if MatchParen's background
color is not set to something different from the normal background.
This is because several syntax files use red to highlight parentheses
by default. If bold fonts are not used, matching parentheses may be
not be visible at all.
6. I don't like red on grey (see MatchParen in original Solarized) or
red next to grey.
So, these are the choices I've made:
- In the normal and high contrast variant the cursor is now orange and
MatchParen's background is grey (with white foreground, see 6 above).
This achieves the twofold goal of being able to see a matching
parenthesis when 'cursorline' is on and being able to clearly
distinguish the cursor from the matching parenthesis. Orange is
preferred to red because of 6 (with two consecutive parentheses
you have a grey block and an orange block next to each other).
- In the flat and low contrast variant the cursor is grey, exactly as in
the original Solarized. This choice is made because such variants
should have less contrast in general, and because 'cursorline' poses
no problem as it does not change the text background.
- The flat variant uses the colors that were used previously for all the
variants. Even without boldface, the matching parenthesis can be seen
because it has a slightly darker background (see 1).
- The low contrast variant uses the darker white for the normal
background, so MatchParen has a transparent background and a nearly
black foreground. This does not particularly stand out without
boldface, but hey, it's low contrast.
This is the first of a couple of commits whose goal is to fix issues
with Cursor and MatchParen highlights. In particular, we strive to find
combinations that are pleasant and permit to distinguish matched
parentheses easily. More about this in the next commit.
In light themes, when cursorline is on and bold fonts are not used,
MatchParen highlighting is not visible. This commit solves the problem
by setting the foreground color to red, as in the original Solarized.
Fixes https://github.com/lifepillar/vim-solarized8/issues/15.
Problem: MatchParen highlighting in light themes inverts colors of
bracket, makes it look like cursor has jumped to matching bracket.
Solution: keep the parenthesis's foreground color when highlighted, and
make the background slightly darker instead of grey.
Fixes https://github.com/lifepillar/vim-solarized8/issues/11.
For all schemes other than the flat one, when g:solarized_contrast is
not low, use the same colors as the original Solarized for the status
line, with the exception of the dark high-contrast scheme, where the
colors of StatusLine have been darkened a bit to make them compatible
with WildMenu.
For some reason, using ctermbg=7 causes the ^^^ symbols to appear in the
status line when the high contrast variant is active. That happens both
in terminal and in MacVim. Setting the foreground to 15 fixes the
problem (that is high contrast anyway).
The content of this file is adapted from the original Solarized theme.
The color palette is exactly the same, but I have removed some cruft and
made some adjustments here and there (see the comments) to better suit
my taste. For example, I can't stand dark text on a red background, so
I have changed ErrorMsg to use a white foreground even in dark mode.
I have not removed *all* the bullshit Solarized source, as the
[Flattened](https://github.com/romainl/flattened.git) theme does,
because I like the possibility of using different contrast levels
(besides Solarized's low, normal, and high contrast modes, I have even
added my own). Although this file may be used as it is, I plan to use it
to generate eight "presets", four with a dark background and four with
a light background, one for each contrast level. Then, I'll keep this in
a development branch, but I plan to remove it from master.
I have started this project because recent Vim versions support true
color terminals, i.e., they use gui color definitions. The original
Solarized does not define guifg and guibg when used by terminal Vim.
This project works in true color terminals out of the box (tested with
iTerm), besides working in GUI Vim (of course), and in terminals using
Solarized 16-color palette. The degraded 256-color version of Solarized
has been removed, because it is ugly and useless (for me). It's called
Solarized8 because true color support will make its way into the
upcoming Vim 8 release.
I have added an option to set the background color of the active status
line to the same color as the inactive status line
(g:solarized_statusline). Besides, I have added a few highlight groups:
NormalMode
InsertMode
VisualMode
CommandMode
ReplaceMode
I need these changes for my own status line (whose color changes
according to the current mode). Other users may safely ignore them.