On 08/06/09 08:11, Jeri Raye wrote:
>
>>> But note that 'filetype' is a concept that applies to a particular
>>> buffer, while colorschemes are global - this won't make a lot of sense
>>> if you ever open a second file of a different filetype in the same vim
>>> instance.
>
> Is it possible to do something like below?
>
> (pseudo code)
> if (filetype == aaa)
> let g:colors_name = "aaa_colors"
> else
> let g:colors_name = "default_colors"
> endif
>
>
>
> or something like:
>
> (pseudo code)
> if (filetype == aaa)
>
> hi Comment gui=NONE guifg=blue guibg=white
> hi Statement gui=NONE guifg=blue guibg=white
> hi Identifier gui=NONE guifg=blue guibg=white
> hi PreProc gui=NONE guifg=blue guibg=white
> hi Type gui=NONE guifg=blue guibg=white
> hi Constant gui=NONE guifg=blue guibg=white
>
> else
>
> hi Comment gui=NONE guifg=white guibg=blue
> hi Statement gui=NONE guifg=white guibg=blue
> hi Identifier gui=NONE guifg=white guibg=blue
> hi PreProc gui=NONE guifg=white guibg=blue
> hi Type gui=NONE guifg=white guibg=blue
> hi Constant gui=NONE guifg=white guibg=blue
> endif
>
> Rgds,
> Jeri
For this second example, you could take advantage of the fact that each
syntax script uses a different set of highlight groups, linked to
Comment, Statement, etc. So for instance (and replacing part of the text
by ... out of laziness (and I didn't check the names)
hi htmlComment...
hi htmlStatement...
hi htmlIdentifier...
hi htmlPreProc...
...
hi cComment...
hi cStatement...
hi cIdentifier...
hi cPreProc...
...
hi vimComment...
hi vimStatement...
hi vimIdentifier...
...
hi helpComment...
...
etc.; just look in the $VIMRUNTIME/syntax/*.vim scripts for the
languages you use to get the names (and since sometimes a is linked to b
which is linked to c which is linked to foobarComment which is linked to
Comment, you don't need to set colors for a, b and c if it's OK for you
to have them the same as foobarComment).
Best regards,
Tony.
--
Did you know that clones never use mirrors?
-- Ambrose Bierce, "The Devil's Dictionary"
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---