On 17/03/09 01:57, pansz wrote:
>
> Marco Ippolito 写道:
>> Could anybody please help me modify the
>> above-mentioned script (currently at ver. 0.2.7) so that it
>> successfully detects "light-coloured-background-sessions" and switches
>> to the alternative colour set? That would be really appreciated, I
>> spent a bit of time on this and I fear is beyond my current
>> understanding of cterm colouring! Thanks a million in advance! This
>> mailing list *rocks*, by the way :-) Ciao! - Marco
>
> Vim will try to detect the light or dark background of your cterm,
> however it is not reliable because there really is no reliable way to do
> that.
>
> So you may need to add :set background=dark or :set background=light to
> your .vimrc, or to map this two commands to some keyboard shortcut and
> do it on the fly.

...unless you can detect it otherwise: for instance, I have a black 
background in the Linux console, a pale yellow one in konsole, a white 
one in xterm, gnome-terminal or gvim, and on Dos/Windows I used to have 
a dark blue one in the console, so if my Vim didn't detect it correctly 
I could replace

        hi clear Normal
        set bg&
        hi clear

by

        if (!has('gui_running')) &&
            \ (&term =~ '^\%(linux\|win32\|pcterm\)$')
                set bg=dark
        else
                set bg=light
        endif
        hi clear

at the top of my owncoded colorscheme.


Best regards,
Tony.
-- 
"One planet is all you get."

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to