On Wed, Aug 25, 2010 at 08:55:38AM -0700, Ben Fritz wrote:
> > All the 'highlight' commands in my .vimrc seem to get overridden by the
> > colorscheme.
> 
> What do you mean, "overridden"? The groups you use below
> (WhiteSpaceEOL and OverLength) don't exist in any widely-distributed
> colorschemes that I know of (maybe I'm wrong), so they shouldn't be
> getting any new values from your colorscheme.

Hi Ben,

thanks for having a look into this.
What I mean is that the highlight values (WhiteSpaceEOL and OverLength)
are *not* available for matching when I use the colorscheme command
(beforehand!).

> > I have the following commands in my .vimrc, slightly abbreviated:
> >
> > colorscheme delek
> > highlight WhiteSpaceEOL ctermbg=darkgreen guibg=lightgreen
> > match WhiteSpaceEOL /\s\+$/
> > highlight OverLength ctermbg=red ctermfg=white guibg=#592929
> > match OverLength /\%81v.\+/
> >
> 
> First of all, this won't work. Your second "match" command will
> override the first, and it wil only take effect on the first window
> Vim opens. Any further windows will remain unaffected. You'd need to
> also run the commands on any newly created windows, maybe with
> WinEnter or BufWinEnter autocmds, and use matchadd() instead of
> just :match (or use both :match and :2match).

Thanks for the advice--the match commands were not the problem, though.
You're right, the way I wrote it in the email would not have the desired
effect. But it doesn't even apply the second match to the first window I
open. It does nothing, because the highlight values (WhiteSpaceEOL and
OverLength) get lost somewhere; where exactly is what I'm trying to
figure out.

However, when I delete the colorscheme command, they get remembered. I
can then run the match commands in any window I open, and they work
(individually, of course).

Here's a concise problem description:

Using this snippet in .vimrc
"""
colorscheme delek
highlight WhiteSpaceEOL ctermbg=darkgreen guibg=lightgreen
highlight OverLength ctermbg=red ctermfg=white guibg=#592929
"""

I can't use the highlight values WhiteSpaceEOL and OverLength anywhere.
However, if I delete the 'colorscheme' line, I can.

What I expect:
- That I can run a command like :match OverLength <pattern> with this
  .vimrc
What happens:
- 'OverLength' gets forgotten somewhere and the matching works, but
  doesn't set a color

I checked I don't load the colorscheme anywhere else.

> Secondly, regarding your OverLength match...are you aware of the new
> ColorColumn feature in Vim 7.3? This new feature made such matches
> obsolete for my own use anyway.

No, I haven't upgraded yet. Thanks for the pointer.

MB

-- 
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin Braun
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-3790
Fax: +49 721 608-6071
www.cel.kit.edu

KIT -- University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association

Attachment: pgpWuq1SlV15N.pgp
Description: PGP signature

Reply via email to