-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Color schemes after 30ab04e16e1e9e6133590181197b3f8e70cb495e are "broken" #10449
Comments
|
ping @romainl |
|
With remade colorschemes all of them now have explicitly defined Normal colors. There might be several solutions to this:
|
|
Whether the background should be transparent or not is a user choice. It has a drastic effect, thus we could even duplicate the set of color schemes to make a transparent version of each. So we would have "pablo" and "pablo-transp". |
|
Some of the originals specify a background while some others don't so, if transparency is a user choice, then that choice is expressed by choosing a colorscheme without a background. FWIW, these are the original cases: Background defined for GUI and TUI via
|
Another alternative is to use in user vimrc |
|
Yes, I would think this configured by the user by making use of such an autocommand. That's what they are for after all :) |
|
It's not just transparency, I don't use that and many schemes now have a light background instead of dark. Exact behaviour depends on the terminal; for xterm I have a fully coloured light background (so it looks reasonably correct though an unwelcome change to before) or for rxvt-unicode I have a mixture of light background where text is printed (e.g. the message displayed when opening vim with no file) and dark (unprinted lines). Example before/after with delek in rxvt-unicode: |
|
@habamax , Don't know why (I have some sort of color blindness) but I think that colors are changed (I'm using |
|
@vp1981 The colors have changed, yes. We spent months remaking the colorschemes shipped with Vim, which implied, among other things, fixing their color palette so that they offer a more consistent experience across environments. In many cases we had to deal with colorschemes being radically different in color terminals and in GUI. In such cases, we favored the GUI colors because they tended to be the most specific and the most explicit. In doing so, we knew from the start that some users who would have gotten used to their colorscheme's brokenness over time would be surprised by the changes and, probably, unhappy. But that's how change goes. If you are not satisfied with the remakes, you can still grab the originals over there and put them in your |
|
@romainl ,
I appreciate your work, but choosing colors is a pain for me. Still, do I understand correctly that if I want to play around with colors in terminal (alacritty), say, for the 'pablo' theme, I should look into settings from the line https://github.com/vim/colorschemes/blob/master/colors/pablo.vim#L20 |
|
That is understandable and I would say, if you found a reasonably well working (legacy) color scheme that works well enough for you, I would just grab the old version pablo in this case download it into your Note, I believe creating a good working color scheme for color impacted people (I am also one of those), is also a goal of the colorschemes sub-project, but we are not there yet. |
|
@vp1981 you have quite a few options:
|
|
@habamax ,
your advice with `augroup` works fine with following settings in `vimrc`:
```
augroup transparent_bg | au!
au Colorscheme * hi Normal ctermbg=NONE
augroup END
color pablo
```
Don't know why (I have some sort of color blindness) but I think that
colors are changed (I'm using `pablo`). Is it true or just my
perception?
The section in the help for colorschemes dives into details too quickly.
Let me move the :colorscheme command out of the section about
highlighting and add some high level remarks.
…--
You can tune a file system, but you can't tuna fish
-- man tunefs
/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
|
@brammool do you mean that you are going to do those changes in the doc or that they should be done? |
|
@brammool do you mean that you are going to do those changes in the
doc or that they should be done?
I have made some changes, will send them out soon. Then we can further
improve on top of that.
…--
Marriage isn't a word. It's a sentence.
/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
Per [1], vim 8.2.4981 reworks the provided colour schemes, including pablo. Some changes include using colours that match those of xterm more closely (e.g. very dark background, extremely dark blue), which is undesirable in my case. Update custom pablo colour scheme (including changing name to more apt "pablolegacy" from "my-pablo") to have it match the legacy pablo colour scheme instead of the new one. [1] vim/vim#10449
|
After the update, the default color scheme is different from the color scheme At least for me, once the default color scheme is changed, there is no way to get it back unless you run the app again. UPDATE: for me, legacy color scheme |
|
@alepinio, we didn't touch As for The original If you prefer the original |
|
@alepinio recently changes tried to fix |
this includes new colour schemes. they aim to be more consistent in different environments (e.g. between text and gui versions), but in some cases significantly change what people are familiar with. a copy of the old colour schemes is installed under the "legacy" directory to make it easier to revert if desired. you can either use them directly in config, or (probably better if you share config files between machines) copy the relevant files from /usr/local/share/vim/vim82/colors/legacy to ~/.vim/colors which take priority. for more information, see https://github.com/vim/colorschemes vim/vim#10449 (comment)
|
Please note, if you are using alacritty terminal it identifies itself as 'alacritty' not 'xterm-256color'. I believe there are some hardcoded checks in Vim for an xterm-ish string identifier for $TERM (or maybe it's going straight to terminfo?). One solution you can try @vp1981 is this: if $TERM ==# 'alacritty'
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endifin your |
|
@craigmac, thanks but it doesn't work for me. I have a transparent ( I ended up modifying the new P.S. I tested your settings in tmux running in alacritty and in just alacritty. |
|
It's worth repeating that the remakes are all based on the highest-definition information available, which is the GUI colors. They are, because of their range, where the author's intent is the most explicit so that's where we got most of our cues. Sadly, colorschemes like the original pablo were not designed carefully or they were but against the author's specific terminal palette, etc. So you get a very precise and specific The remakes aim to make all of this more consistent. |
|
@craigmac, thanks but it doesn't work for me. I have a transparent
(`opacity: 0.9`) background in alacritty and though it is sometimes
awkward, I'm used to it. I tried your settings, but I lost the
transparency. Besides, new pablo color theme (I tested only it) has
very "unpleasant" (for me, please note, I have some kind of color
blindness) colors for "Special" and "Identifier" (for example, for
`([{}])` and others).
I ended up modifying the new `pablo` theme a bit (reverting old colors
for "Special" and "Identifier") and I'm using it in vim (vim runs in
terminal, `tmux` and `ssh`).
For now we settled on keeping the opacity and setting the Normal color,
since this is needed to make the colorscheme work in most places.
In case you prefer a transparent background, you can use an autocommand
to set that. There is an example in the help:
augroup my_colorschemes
au!
au ColorScheme pablo hi Normal ctermbg=NONE
augroup END
With the latest Vim it can be one call (untried):
call autocmd_add([#{event: 'ColorScheme',
\ group: 'my_colorschemes',
\ pattern: 'pablo',
\ cmd: 'hi Normal ctermbg=NONE'
\ replace: v:true,
\ }])
Color blindness I'm afraid is very difficult to tackle. Mainly because
every person has a different kind. You can try the available colors
schemes to find one that works best, and then use a ColorScheme
autocommand to tune it.
…--
WOMAN: King of the who?
ARTHUR: The Britons.
WOMAN: Who are the Britons?
ARTHUR: Well, we all are. we're all Britons and I am your king.
The Quest for the Holy Grail (Monty Python)
/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
|
Regarding color blindness, there are a couple of colorschemes specifically designed for that and I would like to have one included (not necessarily mine) but…
|
|
Note: there is also vim/colorschemes#163 which specifically adresses dyslexia, not sure if this is the same as color blindness |
|
@chrisbra no, they are very different, unrelated things. People affected by some forms of color blindness have troubles discerning two colors with different hues but equal or near-equal brightness because the hue is messed while the brightness is not, so the two colors are both reduced to the same or almost same color. That is why accessibility guidelines generally suggest to avoid using only color to differentiate functionalities and why a colorscheme designed for color blindness must have a high contrast between the colors in the palette). For people with dyslexia, the stuff I've found online is not super conclusive: some research point to high contrast helping and others point to low contrast being better. From my little understanding, it seems to depend on what people actually do: browsing (high contrast is better) or reading (low contrast is better). A distinction that might be hard to tackle in a Vim colorscheme. |
|
I think it is worth to mention in documentation about possible ways to get desire result. I have settled on the following in |
Bram is on it.
That is a sensible change because 44 (#00d7d7) is closer to the intended #00c0c0 than 37 (#00afaf). You should make a PR in vim/colorschemes using the actual template.
The intended color is #0000ff so 21 is the correct value. While 63 (#5f5fff) is closer to the xterm default I think we should keep the intended color. --- EDIT --- In any case, here is a revised snippet for your |
|
I think it is worth to mention in documentation about possible ways to
get desire result. I have settled on the following
```
augroup transparent_bg | au!
au Colorscheme * hi Normal ctermbg=NONE
augroup END
color pablo-t
```
in `.vimrc`. The colortheme `pablo-t` is almost the same as new
`pablo` but with some differences:
You could do this with the original "pablo" scheme and do:
augroup transparent_bg | au!
au Colorscheme * hi Normal ctermbg=NONE
au Colorscheme pablo hi Identifier ctermfg=37
au Colorscheme pablo hi Special ctermfg=63
augroup END
color pablo
Right?
…--
ARTHUR: I am your king!
WOMAN: Well, I didn't vote for you.
ARTHUR: You don't vote for kings.
WOMAN: Well, 'ow did you become king then?
The Quest for the Holy Grail (Monty Python)
/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
|
@brammool , yes, thank you! Brilliant solution, I like it and am using it now. @romainl , Bram's code makes more sense to me than this because and I don't understand where this |
|
FWIW: OpenBSD ports now install old color schemes by default since this is too abruptive. I have made the same request for FreeBSD ports as well. I am totally not happy with my beloved |
|
Is this just because of the Normal highlighting group? Or what exactly is the problem? |
Many (all?) legacy colorschemes were using first 16 colors no matter if there is 256 color support in the terminal. This is the reason slate was different to almost everyone. Blue statement was a different blue statement depending on the terminal definition of the blue. |
|
I believe if @michael-o would put |
|
Here is a perfect example of the incoherent mess we had to deal with, taken from legacy slate: Of note:
Your "beloved slate" didn't even look the same on two machines accessed from the same terminal emulator. It has always been broken. The new slate at least looks the same everywhere, that's quite the improvement The design choice in the new slate are dictated by the most hi-def "source of trust" we could find: the GUI colors defined in the original slate itself, which inevitably impacts your terminal experience. That is a trade-off we chose to make in the name of consistency. Reverting new slate to the hot mess that was legacy slate is, IMO, not going to happen. That's why we preserved the legacy colorschemes. But there are definitely mistakes in new slate, like |
|
@michael-o Are you sure
This may be the reason. That said, I agree that the new color schemes are “disruptive”, but in a positive way. I am all for backward compatibility, but insisting on keeping 20th century's broken behavior for the sake of compatibility is silly. For instance, to test the above, I first loaded legacy slate from my terminal, which has a light background. Of course, the color scheme was unusable, because it was meant to be used with a terminal's dark background. With the new slate, this is a non-issue. And it is just one of the countless improvements people working on the new color schemes have made. |
|
why not just gave another indicating name?
e.g `slate-256`
// maybe `silly` but people used to that :-)
// though separated to new name, but I guess it is unlike py2 vs py3.
…--
shane.xb.qian
|
That would have doubled the number of color schemes and might have been confusing for many users.
Maybe the legacy color schemes could be put in |
I totally appreciate your work, do understand the mess and don't expect to revert. I think it was the right think to do, but should have been done in 9 with accompanying text. |
Well, with PuTTY, both OSes show my t_Co=8. I have then tried from Windows Terminal with PowerShell 7 and OpenSSH 8.9 to connect to both machines. Completely different. FreeBSD is now at t_Co=256 and HP-UX is just black and white because |
This would arguably have been much worse: few people read the documentation, a lot of people have oddball setups, and we'd have drowned under both justified and unjustified bug reports. Later down the line, some linux distributions might have decided to ship vim9.0 with cherry-picked security fixes but none of the runtime updates that would have fixed issues with the colorschemes. There's no way to do it that doesn't involve some amount of pain, but updating the runtime so that early adopters could report potential issues and give us the opportunity to fix them before a major release was the right call. |
Right. Whatever you do you do it wrong. |
|
@michael-o there is some work going on vim/colorschemes#207 I have aligned as much as I could TUI 8/16 colors between legacy and new slate. |
|
This made me learn why it’s called peachpuff. Oh dear, the background is peach! |
|
you can install the legacy colorschemes as well: https://github.com/vim/colorschemes/tree/master/legacy_colors |
Vim does not support the Alacritty terminal emulator by default. Treat Alacritty as an "xterm"-compatible terminal emulator as a naive solution. This is _not_ a foolproof solution. Alacritty does not claim to be an "xterm"-compatible terminal emulator; however, it does appear to use "xterm-256color" as fallback option. Therefore, I feel reasonably comfortable using this approach. These resources provide further information: - <vim/vim#10449 (comment)> - <alacritty/alacritty#3402 (comment)> - <alacritty/alacritty#6091 (comment)> - <https://github.com/alacritty/alacritty/blob/c82de4ccadcaf2e74dc8e8ef2da1ebe13e2ca5a9/alacritty.yml#L18-L24>
Vim does not support the Alacritty terminal emulator by default. Treat Alacritty as an "xterm"-compatible terminal emulator as a naive solution. This is _not_ a foolproof solution. Alacritty does not claim to be an "xterm"-compatible terminal emulator; however, it does appear to use "xterm-256color" as fallback option. Therefore, I feel reasonably comfortable using this approach. These resources provide further information: - <vim/vim#10449 (comment)> - <alacritty/alacritty#3402 (comment)> - <alacritty/alacritty#6091 (comment)> - <https://github.com/alacritty/alacritty/blob/c82de4ccadcaf2e74dc8e8ef2da1ebe13e2ca5a9/alacritty.yml#L18-L24>
Vim does not support the Alacritty terminal emulator by default. Treat Alacritty as an "xterm"-compatible terminal emulator as a naive solution. This is _not_ a foolproof solution. Alacritty does not claim to be an "xterm"-compatible terminal emulator; however, it does appear to use "xterm-256color" as fallback option. Therefore, I feel reasonably comfortable using this approach. These resources provide further information: - <vim/vim#10449 (comment)> - <alacritty/alacritty#3402 (comment)> - <alacritty/alacritty#6091 (comment)> - <https://github.com/alacritty/alacritty/blob/c82de4ccadcaf2e74dc8e8ef2da1ebe13e2ca5a9/alacritty.yml#L18-L24>









Steps to reproduce
Expected behaviour
Before the commit 30ab04e the background for some color scheme (I checked only pablo and ron) was tranparent, because that is how my terminal emulator is configured.
Version of Vim
8.2.4980
Environment
Archlinux x86_64
alacritty 0.10.1 and qterminal 1.1.0
bash: 5.1.16(1)
TERM:
alacritty:
qterminal:
Changing TERM in alacritty to xterm-256color doesn't change nothing.
To illustrate the problem, please see the screenshots
alacritty (with tgc off)
alacritty (with tgc on)
qterminal (with tgc off)
qterminal (with tgc on)
Logs and stack traces
No response
The text was updated successfully, but these errors were encountered: