Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't define color palette solely in Xresources with g:gruvbox_termcolors = 16 #50

Closed
rbong opened this issue May 28, 2019 · 2 comments
Closed
Labels
migrated Issues migrated from morhetz/gruvbox

Comments

@rbong
Copy link

rbong commented May 28, 2019

I would like to have Xresources as the single place to define my system-wide color palette and have Vim use that by setting let g:gruvbox_termcolors = 16. However:

  1. Currently I have to specify set background=dark or set background=light in my Vim configuration, depending on the Xresources color scheme. Otherwise, the cursor line has the opposite color.
  2. The Vim background color does not perfectly match the background color in Xresources, which is what I would assume when using let g:gruvbox_termcolors = 16.

So I can't just change the Xresources colors to change my color scheme, but also have to edit the Vim configuration. Is there a way around these two issues?

🤖 This issue has been automatically copied from morhetz#130 🤖

@rbong rbong added the migrated Issues migrated from morhetz/gruvbox label May 28, 2019
rbong added a commit that referenced this issue Jun 2, 2019
This allows vim to guess the value of &background. This will set the
best colors based on system configuration. This will especially help
while using 16 colors: see #50

This disables the fix for morhetz#7 temporarily while entering
vim. It should still be possible to switch to and from light and dark
mode afterwards.
rbong added a commit to gruvbox-community/gruvbox-contrib that referenced this issue Jun 2, 2019
For themes that do not have identical background/color0 and
foreground/color15 there is now alternative 16 color themes. Vim cannot
expressly get the foreground/background color so gruvbox must use 0/15.

Related to gruvbox-community/gruvbox#50
@rbong
Copy link
Author

rbong commented Jun 2, 2019

It should now be possible to use just 16 colors.

For Vim to detect whether to use light/dark, your terminal must support retrieving the foreground/background color. See :help t_RB. This is supported in urxvt, kitty, and possibly soon alacritty (now available on master).

Note that you need to set color 0 to the background color and color 15 to the foreground color, Vim does not have a way to expressly get the foreground and background color.

I have provided terminal configurations where the colors match in gruvbox-contrib.

@rbong rbong closed this as completed Jun 2, 2019
rbong added a commit to gruvbox-community/gruvbox-contrib that referenced this issue Jun 3, 2019
16-color variations were added for gruvbox-community/gruvbox#50

They were added because config file color 0/15 did not match the fg/bg.

It appears, though, that all configs where this was not the case were a
mistake.
rbong added a commit to gruvbox-community/gruvbox-contrib that referenced this issue Jun 3, 2019
Related to gruvbox-community/gruvbox#50

Some configs use light/hard colors incorrectly, some use old colors.
@rbong
Copy link
Author

rbong commented Jun 3, 2019

Some of the colorschemes in gruvbox-contrib were using old colors or hard/light backgrounds where they weren't supposed to. If I missed any let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
migrated Issues migrated from morhetz/gruvbox
Projects
None yet
Development

No branches or pull requests

1 participant