From de124fa1ea300b02daa0a17219a77d959b5f25d4 Mon Sep 17 00:00:00 2001 From: Lifepillar Date: Wed, 26 Jun 2019 19:33:28 +0200 Subject: [PATCH] Reinstate g:solarized_use16. Neovim ignores `&t_Co` and `&term`, so it is not possible in Neovim to use the ANSI colors when `termguicolors` is not set. Re-add this option to override the value of `s:t_Co`. Fixes https://github.com/lifepillar/vim-solarized8/issues/71. --- Readme.md | 8 +++++--- templates/_global.colortemplate | 1 + templates/_help.colortemplate | 23 ++++++++++++++--------- templates/solarized8.colortemplate | 5 +---- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/Readme.md b/Readme.md index 8e7613c..9260c2b 100644 --- a/Readme.md +++ b/Readme.md @@ -48,9 +48,10 @@ you have two possibilities: effect). 2. Set your terminal's 16 ANSI colors (the colors in the range 0–15) to the - Solarized palette and `set t_Co=16` in Vim. Be aware that, if you set `t_Co`, - but your terminal does not use the Solarized palette, your colors will be - completely off. + Solarized palette and `set t_Co=16` in Vim (or `let g:solarized_use16=1`). Be + aware that, if you force the usage of your terminal colors, but your terminal + is not configured with the Solarized palette, your colors will be completely + off. Finally, if your terminal does not support true colors, you must *not* set `termguicolors`. @@ -131,6 +132,7 @@ The following options were not available in the original Solarized: Solarized's cursor style (default: `0`). By default, the cursor is orange/red in light themes, and blue in dark themes (but please note that your terminal may override the cursor's color). +- `g:solarized_use16`: set to `1` to force using your 16 ANSI terminal colors. - `g:solarized_extra_hi_groups`: set to `1` to enable Solarized filetype-specific syntax highlighting groups (default is `0`). Please be aware that there is [a long standing issue](https://github.com/vim/vim/issues/4405) diff --git a/templates/_global.colortemplate b/templates/_global.colortemplate index 297bb1c..0237eda 100644 --- a/templates/_global.colortemplate +++ b/templates/_global.colortemplate @@ -1,4 +1,5 @@ # vim: ft=colortemplate fdm=marker +#let s:t_Co = get(g:, '@optionprefix_use16', 0) ? 16 : s:t_Co #let s:italics = s:italics && get(g:, '@optionprefix_italics', 1) #let s:termtrans = get(g:, '@optionprefix_termtrans', 0) && !has('gui_running') Include: _linked_groups.colortemplate diff --git a/templates/_help.colortemplate b/templates/_help.colortemplate index 1b21f5f..57f9670 100644 --- a/templates/_help.colortemplate +++ b/templates/_help.colortemplate @@ -23,6 +23,15 @@ Set to 1 to enable filetype-specific syntax highlight group. NOTE: setting this to 1 may leave "a wake of destruction when switching away" (T. Pope), that is, when you switch to a different colorscheme the highlighting may look wrong or disabled. + *g:@optionprefix_italics* +Set to 0 if you do not want to enable italics. Note that the color scheme in +normal circumstances automatically detects whether italics is available. You +should never need to set this option explicitly. You may want to unset it if +you do not want Vim to display italics even when the feature is available +(e.g., in GUI versions of Vim). +> + let g:@optionprefix_italics = 1 +< *g:@optionprefix_old_cursor_style* Set to 1 if you want to use the original Solarized's cursor style. By default, @@ -37,21 +46,17 @@ in the flat variant (of course, `"flat"` does not have any effect in the flat variant). > let g:@optionprefix_statusline = "normal" -< - *g:@optionprefix_italics* -Set to 0 if you do not want to enable italics. Note that the color scheme in -normal circumstances automatically detects whether italics is available. You -should never need to set this option explicitly. You may want to unset it if -you do not want Vim to display italics even when the feature is available -(e.g., in GUI versions of Vim). -> - let g:@optionprefix_italics = 1 < *g:@optionprefix_termtrans* Set to 1 if you want a transparent background. Takes effect only in the terminal. > let g:@optionprefix_termtrans = 0 +< + *g:@optionprefix_use16* +Set to 1 if you want to force using the 16 ANSI terminal colors. +> + let g:@optionprefix_use16 = 0 < *g:@optionprefix_visibility* Tweak the visibility of a few elements. Allowed values are `"normal"` diff --git a/templates/solarized8.colortemplate b/templates/solarized8.colortemplate index cefc590..fbaecb0 100644 --- a/templates/solarized8.colortemplate +++ b/templates/solarized8.colortemplate @@ -9,10 +9,7 @@ Include: _info.colortemplate Include: _help.colortemplate # }}} -#let s:italics = s:italics && get(g:, '@optionprefix_italics', 1) -#let s:termtrans = get(g:, '@optionprefix_termtrans', 0) && !has('gui_running') - -Include: _linked_groups.colortemplate +Include: _global.colortemplate Variant: gui 256 16