lifepillar / vim-solarized8

Optimized Solarized colorschemes. Best served with true-color terminals!
998 stars 87 forks source link

Forcing use of 16 terminal colors does not seem to work #115

Closed willvousden closed 6 days ago

willvousden commented 1 week ago

I followed the instructions in Readme.md to make Neovim/solarized8 use the terminal's color palette, but the colorscheme does not seem to respect it.

Expected behaviour

After setting the terminal colors appropriately, I expected them to be used regardless of whether background=dark or background=light.

I'm using iTerm2 3.5, which automatically swaps the color palette for light/dark based on the system appearance, and I would expect the appearance of Neovim to reflect that. This is why I would like to force the use of the 16 terminal colors 🙂

Actual behaviour

Instead, I get the colors corresponding to the background setting in Neovim, regardless of which color palette the terminal has.

If I set a completely different (non-solarized) palette, Neovim still uses the solarized colors.

My environment

Minimal vimrc

call plug#begin()
Plug 'lifepillar/vim-solarized8'
call plug#end()

let g:solarized_t_Co=16
colorscheme solarized8

Screenshot

Note that the terminal window is using Solarized light colors (because the OS is in light mode), but Neovim still shows up dark (because background=dark):

Screenshot 2024-07-06 at 21 47 13
lifepillar commented 1 week ago

Does addingset notermguicolors before loading the color scheme help?

willvousden commented 1 week ago

Not quite; the effect seems to be for it to revert to the 256 color xterm palette, as shown in the screenshots in the README: https://github.com/lifepillar/vim-solarized8?tab=readme-ov-file#but-my-terminal-has-only-256-colors

But it still does not use the terminal's colors.

lifepillar commented 1 week ago

Please double check that you are using the neovim branch of this repository, and not master. Manually:

git clone https://github.com/lifepillar/vim-solarized8.git
git checkout neovim

I suppose vim-plug will have something equivalent to specify the branch.

With the following, I get Neovim to use the terminal colors in iTerm2:

let g:solarized_t_Co=16
set notermguicolors
colorscheme solarized8
willvousden commented 6 days ago

Thanks, I don't know how I missed that part of the readme! Indeed, using the following fixes the problem:

Plug 'lifepillar/vim-solarized8', { 'branch': 'neovim' }

Sorry for the noise!