From 96dd598b40f388716fcce616a7c944f988587f46 Mon Sep 17 00:00:00 2001 From: Lifepillar Date: Thu, 25 May 2017 14:47:25 +0200 Subject: [PATCH] Update MatchParen in light themes. 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. --- colors/solarized8_light.vim | 2 +- colors/solarized8_light_flat.vim | 2 +- colors/solarized8_light_high.vim | 2 +- colors/solarized8_light_low.vim | 2 +- src/solarized8.vim | 10 ++++++++-- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/colors/solarized8_light.vim b/colors/solarized8_light.vim index 53699c5..a311112 100644 --- a/colors/solarized8_light.vim +++ b/colors/solarized8_light.vim @@ -138,7 +138,7 @@ if has('nvim') let g:terminal_color_14 = '#93a1a1' let g:terminal_color_15 = '#fdf6e3' endif -hi! MatchParen cterm=NONE,bold gui=NONE,bold ctermfg=1 guifg=#dc322f ctermbg=7 guibg=#eee8d5 +hi! MatchParen cterm=NONE,bold gui=NONE,bold ctermfg=15 guifg=#fdf6e3 ctermbg=12 guibg=#839496 hi! link vimVar Identifier hi! link vimFunc Function hi! link vimUserFunc Function diff --git a/colors/solarized8_light_flat.vim b/colors/solarized8_light_flat.vim index b57b69e..127f0e8 100644 --- a/colors/solarized8_light_flat.vim +++ b/colors/solarized8_light_flat.vim @@ -136,7 +136,7 @@ if has('nvim') let g:terminal_color_14 = '#93a1a1' let g:terminal_color_15 = '#fdf6e3' endif -hi! MatchParen cterm=NONE,bold gui=NONE,bold ctermfg=1 guifg=#dc322f ctermbg=7 guibg=#eee8d5 +hi! MatchParen cterm=NONE,bold gui=NONE,bold ctermfg=9 guifg=#cb4b16 ctermbg=7 guibg=#eee8d5 hi! link vimVar Identifier hi! link vimFunc Function hi! link vimUserFunc Function diff --git a/colors/solarized8_light_high.vim b/colors/solarized8_light_high.vim index 2b13b2f..dff9280 100644 --- a/colors/solarized8_light_high.vim +++ b/colors/solarized8_light_high.vim @@ -138,7 +138,7 @@ if has('nvim') let g:terminal_color_14 = '#93a1a1' let g:terminal_color_15 = '#fdf6e3' endif -hi! MatchParen cterm=NONE,bold gui=NONE,bold ctermfg=1 guifg=#dc322f ctermbg=7 guibg=#eee8d5 +hi! MatchParen cterm=NONE,bold gui=NONE,bold ctermfg=15 guifg=#fdf6e3 ctermbg=11 guibg=#657b83 hi! link vimVar Identifier hi! link vimFunc Function hi! link vimUserFunc Function diff --git a/colors/solarized8_light_low.vim b/colors/solarized8_light_low.vim index 1a5df7c..f45148b 100644 --- a/colors/solarized8_light_low.vim +++ b/colors/solarized8_light_low.vim @@ -138,7 +138,7 @@ if has('nvim') let g:terminal_color_14 = '#93a1a1' let g:terminal_color_15 = '#fdf6e3' endif -hi! MatchParen cterm=NONE,bold gui=NONE,bold ctermfg=1 guifg=#dc322f ctermbg=7 guibg=#eee8d5 +hi! MatchParen cterm=NONE,bold gui=NONE,bold ctermfg=8 guifg=#002b36 ctermbg=NONE guibg=NONE hi! link vimVar Identifier hi! link vimFunc Function hi! link vimUserFunc Function diff --git a/src/solarized8.vim b/src/solarized8.vim index 020b785..46c89ae 100644 --- a/src/solarized8.vim +++ b/src/solarized8.vim @@ -507,10 +507,16 @@ for s:solarized_background in ["dark", "light"] " Changed by Lifepillar: better (in my opinion) highlighting for MatchParen " (see also https://github.com/lifepillar/vim-solarized8/issues/11 and " https://github.com/lifepillar/vim-solarized8/issues/15): - if s:solarized_background == 'dark' + if s:solarized_background == "dark" call s:put("hi! MatchParen" .s:fmt_bold .s:fg_base3 .s:bg_base02) else - call s:put("hi! MatchParen" .s:fmt_bold .s:fg_red .s:bg_base02) + if s:solarized_contrast == "flat" + call s:put("hi! MatchParen" .s:fmt_bold .s:fg_orange .s:bg_base02) + elseif s:solarized_contrast == "low" + call s:put("hi! MatchParen" .s:fmt_bold .s:fg_base3 .s:bg_none) + else + call s:put("hi! MatchParen" .s:fmt_bold .s:fg_base03 .s:bg_base00) + endif endif "}}} " vim syntax highlighting "{{{