[Vimoutliner] color schemes messed up

Sam Roberts sroberts at uniserve.com
Mon Mar 12 22:29:21 EST 2007


Quoting timr at probo.com, on Mon, Mar 12, 2007 at 02:00:27PM -0700:
> Sam Roberts wrote:
> > Quoting noel at noels-lab.com, on Mon, Mar 12, 2007 at 09:29:42AM -0700:
> >   
> >> he: vo-color
> >>     
> >
> > Noel,
> >
> > I'm no vim guru, but isn't the advice here not so useful for those using
> > vim for things other than .otl files?
> >
> > This "colorscheme" only sets colors for vo related things, so all the
> > colors for the (presumably standard) kinds of objects set by the
> > colorschemes that come with vim get lost.
> >
> > Wouldn't it make more sense for people to keep using whatever color
> > scheme they currently have (and probably want to have, assuming they use
> > vim for things other than outlining), and to set the vo colors by using
> > a .vim/after/syntax/vo_base.vim file?
> >   
> 
> When I installed vo, it installed two color scheme files in
> vimfiles\colors: vo_dark.vim and vo_light.vim.  Those two color schemes
> apply only to .otl files, and the appropriate file is chosen based on
> whether I have background set to dark or light.  When I switch back to a
> .c file, it has the normal C coloration.

Thats because the two vo ones don't set any of the things that
colorschemes are supposed to set! Setting it goes mostly unnoticed,
except that it resets the Folded and FoldColumn highlighting, and thats
used anywhere folding is, not just by vo.

> Now, I admit that I have played very little with vim color schemes, but
> my experience so far has been that the vo color scheme doesn't affect my
> normal editing.

Try this, go to a buffer with some language (c, perl, whatever), and set
the colorscheme to one of the provided ones:

  :colorscheme blue

for example. Now open a .otl file. What happened? Now call colorscheme
vo_dark there, what happens? Mangling happens.

Warning - I learned all this in my struggle to get vo to have readable
colors on my terminal, so I'm no expert, but here's what I  think I
found out:


As far as I can tell, a colorscheme is supposed to set the hi attribute
for a (fairly) language independent set of stuff. Then the syntax file
(usually) maps language-specific constructs to those
language-independent names. The things a colorscheme does are global, and
effect every syntax (that uses the global language-independent names).
The colorscheme exists as a way of getting colors that generally look ok
to you, but without having to make custom colors for every single
syntax, which would be a huge pain.

This pain is where vo is now, because even though it has the dark/light
switch, it was impossible to read many of the colors it uses on my
terminal. It required customization, I've only ever customized a single
thing about vim default syntax colors up until installing vo!

I think that .vim/syntax/vo_base.vim shouldn't actually have ANY colors
mentioned in it explicitly, it should just map the vo-specific object
types to  the generic object types that can be found in the
/usr/share/vim/colors/*.vim files. Then when a user has a colorscheme
and installs vo, it will use their colorscheme, rather than one of the
two it now sets based on the background setting, the assumption being
that the colors in the users current colorscheme are actually acceptable
to them, or why would they be using them? In my case, that means it will
never use cyan, because I find cyan impossible to read on my terminal!


The color-specific stuff that is in colors/vim_base.vim should be
chopped out into an example file. Then people who want vo objects to use
specific colors, not just the mappings it sets up to their colorscheme,
would copy one of those files to after/syntax/vo_base.vim, and customize
it to their hearts content, and it would have absolutely no effect on
their other syntax colorings.

Cheers,
Sam



More information about the VimOutliner mailing list