Tuesday, February 14, 2012

Re: does highlighting in colorcolumn's work?

On Feb 14, 2:57 pm, Alexey <mura...@math.univ-toulouse.fr> wrote:
> Hello,
>
> is it possible to highlight a match that happens in color columns?
>
> I have set color columns with
>
> :set colorcolumn=79,80
>
> and tried to set highlighting of trailing whitespace with
>
> :autocmd ColorScheme * highlight WhitespaceAtEOL ctermbg=DarkGreen
> guibg=DarkGreen
> :syntax match WhitespaceAtEOL /\s\+$/
>
> The trailing whitespace that occurs in columns 79 or 80 is not
> highlighted, and i do not see how to override this.
>
> This is the same if i do
>
> :match WhitespaceAtEOL /\s\+$/
>

You can try matchadd() and experimentating with the priority instead
of using a syntax match. I'm not sure whether you can override the
colorcolumn, though, it may be always on top by design.

I personally gave up on my whitespace highlight patterns in favor
of :set list, and a 'listchars' setting which actually looks nice and
includes a "trail" definition (using a bunch of fancy Unicode
characters).

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

No comments: