Thursday, February 17, 2011

Re: highlight with transparent background

On 17/02/11 8:24 PM, Jeroen Budts wrote:
> On 02/17/2011 02:13 AM, Ben Schmidt wrote:
>>> I found under :help highlight-guibg that setting guibg to NONE should
>>> result in a transparent background, but when i try this gvim always
>>> uses the background color of the default text as the guibg. Is it
>>> somehow possible to make vim always use the current background color
>>> for the User1 highlight?
>>
>> I think I found that doing
>>
>> :hi Whatever guibg=NONE
>>
>> wasn't sufficient to make this work, but that
>>
>> :hi Whatever NONE
>> or
>> :hi clear Whatever
>>
>> worked. Try putting one of those before a second :hi command that only
>> sets the fg and see if that works.
>>
>
> I tried this with
> :hi clear User2
> :hi User2 guifg=grey
>
> But it still changes the background to the default background color. I also tried
> ':hi User2 NONE' instead of the clear, but that didn't make any difference. I
> guess i'll have to live with it :)

Hmm. IIRC, I also refrain from setting the bg on my Normal highlight
group in the cterm (not gui). Maybe that's relevant. I somewhat doubt
it.

I did somehow get this working, though. I think for me the problem was
the 'Title' highlight which is used in the tabline as well as in message
output, so sometimes needed different background colours. Yes. Just
checked it out, and it's working fine.

Let me try a statusline.... Yep. It doesn't work as I would expect.

But...I can get it to do what I want, by explicitly setting the User1
highlight bg to the same as the StatusLine bg, and Vim automatically
readjusts it in line with this comment from the help:

"The difference between User{N} and StatusLine will be applied
to StatusLineNC for the statusline of non-current windows."

How confusing.

I guess it's a buglet.

Ben.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: