On 23/04/11 04:26, Alan Warren wrote:


On Fri, Apr 22, 2011 at 6:26 PM, Tony Mechelynck
<[email protected] <mailto:[email protected]>> wrote:

    On 22/04/11 18:23, Alan Warren wrote:

        Hello,

        I have a problem with the "ErrorMsg" highlight group being
        ignored in my
        custom colorscheme.  I can reproduce this
        by forcing a typo in my vimrc and reloading my vimrc.  Lines
        starting
        with "Error:" or "E475" etc. are incorrectly highlighted.

        Gvim will show a red background with white text, while vim uses
        colors
        from my ~/.Xdefaults.  Vim actually chooses two
        very light colors, which render the error message completely
        illegible.

        If I change to a colorscheme which sets ErrorMsg successfully,
        then I am
        able to change the color values by hacking the theme.
        The zenburn theme is a good example of a colorscheme which
        successfully
        sets ErrorMsg. However, I cannot for the life
        of me figure out what it's doing different then my own theme.

        I've pasted my theme here, if you would be so kind to inspect it.
        http://pastebin.com/LRLVN86r

        Thanks for your time,
        Alan


        --
        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


    I see two possible problems with these two lines:

    1. You shouldn't set cterm=none after setting ctermfg and ctermbg,
    it might reset your colours to those of the Normal group (the
    colours which were set in the terminal when Vim started up). If you
    want no bold etc. you may set cterm=NONE _before_ setting ctermbg
    and ctermfg

    2. You are setting ctermfg=128 ctermbg=238 without having checked
    that 't_Co' is higher than that. If you find yourself in a 16-color
    terminal or even an 88-color one, anything may happen.

    So, I suggest the following experiment:

    1. Start Console Vim with this color scheme in the problematic terminal.

    2. Type the following commands, and tell us what the answers were:

            :verbose set term? t_Co?
            :verbose hi Error
            :verbose hi ErrorMsg


    Best regards,
    Tony.
    --
    hundred-and-one symptoms of being an internet addict:
    70. ISDN lines are added to your house on a hourly basis



Thanks for the suggestions Tony. I think this may be getting me
somewhere, but not completely there yet.

Here is the output of the commands you mentioned.

:verbose set term? t_Co?
   term=xterm-256color
         Last set from ~/.vimrc
   t_Co=256
         Last set from ~/.vimrc

:verbose hi Error
Error          xxx term=reverse ctermfg=128 ctermbg=234 guifg=#af00d7
guibg=#191919
         Last set from ~/.vim/colors/eclm_special_256.vim

:verbose hi ErrorMsg
ErrorMsg       xxx term=standout ctermfg=128 ctermbg=234 guifg=#af00d7
guibg=#191919
         Last set from ~/.vim/colors/eclm_special_256.vim


The first time I checked the output of the command above for ErrorMsg,
it showed me the very light colors I had been seeing thus far.  I then
moved cterm=none before ctermbg and ctermfg. This displayed the proper
colors in the "xxx" area, but now the error window expands, but all the
text is either not rendering or the same shade of black as my terminal
background. All I can see is my cursor floating off to the right as if
it were at the end of a line of text.

I tested using Gvim, and the error is visible, but remains white on red.

Could the term=standout have something to do with this?

No. The term= argument is (or rather, was) only used on monochrome terminals such as those fed by video cards like the IBM-PC MDA or the Hercules HGC. On color text or graphics cards it is totally ignored.

I've just put online the current versions of my "almost-default" colorscheme http://users.skynet.be/antoine.mechelynck/vim/almost-default.vim (well, it started out as almost default, then it slowly grew -- it still leaves many highlight groups undefined, so the compiled-in defaults are used for them) and my .vimrc http://users.skynet.be/antoine.mechelynck/vim/.vimrc (which may be necessary to understand some colorscheme settings I use). You will probably not use them unchanged, but you may use them as examples and adapt them to your liking. Recently I've also been using the CSApprox plugin, which gives me practically identical colours in a 256-colour terminal as in the GUI (this means most terminal emulators displaying through X11, but not the Linux text-only console which is a "true" 16-fg 8-bg terminal).


Thanks again for your time,
Alan

I hope you'll be able to make your colorscheme work.
Best regards,
Tony.
--
What this country needs is a good five dollar plasma weapon.

--
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

Reply via email to