"A.J.Mechelynck" <[EMAIL PROTECTED]> 写于 2006-10-19 13:42:46:
> (I "think" I read the help correctly in
> understanding that ctermbg=NONE and ctermfg=NONE are not syntactically
valid
> settings, but I'm not 100% sure that I understood it correctly.)
>
>
> Best regards,
> Tony.


Hi Tony,

Thanks very much for your through explanation, I'll read it for some more
time.

What I can confirm is that you have not correctly understand one thing:
ctermbg=NONE is valid and this setting is very important for most
color-scheme developers. It means the background being transparent.

i.e. when the ctermbg=NONE, the background color will be the same as the
terminal background, if your terminal can have a semi-transparent
background, then the background color of the highlight group will be
semi-transparent. Note that the ctermfg=bg and ctermbg=bg is not possible
when ctermbg=NONE. And the ctermbg=NONE is the Vim default setting for most
highlight groups! You must override all those defaults if you don't want
the background be determined by the terminal instead of your Vim
colorscheme.

If you set the ctermbg=Black, then it will always be black, even if your
terminal has a light background by default. So generally you don't need to
worry about the default background of your terminal. What you need to do is
to set ctermbg=Black for Normal highlight group and set ctermbg=bg for all
the rest of highlight groups which you expect the same background as the
Normal highlight group.

If I had not misunderstood the Vim Help document, I should have this: when
the color scheme overrides all the default values, the 'background' option
will have no effect since it only changes the default highlight and they
are all overriden by the color scheme.

This seems to be a "frozen" way but it works better for me. Consider that
the gvim will always have the background="light" and the cterm will have
this determined by the terminal. Many 8-color terminal cannot have a bright
color as the background so it is not be very portable to design a
light-background scheme for color terminal. I forced dark background for
color terminal then nothing need to be detected.

--
Sincerely, Pan, Shi Zhu. ext: 2606

Reply via email to