Re: [OT] Vim highlighting for trailing spaces

From: Kyle Moffett
Date: Fri Jun 29 2007 - 20:00:41 EST


On Jun 29, 2007, at 08:49:42, Dmitry Torokhov wrote:
On 6/29/07, Michael Tokarev <mjt@xxxxxxxxxx> wrote:
highlight WhitespaceEOL ctermbg=red guibg=red
match WhitespaceEOL /\s\+$/

Works without any glitches here (not "laggy"). But I don't use syntax coloring - never tried if it works with coloring or not.


That only highlights whitespace at the end of the lines. You might want to use pattern below to also highlight "tab after space" in the middle of the line:

:highlight RedundantSpaces ctermbg=red guibg=red
:match RedundantSpaces /\s\+$\| \+\ze\t/

You missed the nice part about my vimrc patterns: :-D

Kyle Moffett wrote:
It always displays trailing whitespace and spaces-before tabs... except if your cursor is at the end of the whitespace.

They intentionally *don't* display whitespace at the end of the line to the left of your cursor. I tried that one (that you quoted), but got annoyed by the fact that immediately after you typed any space or tab you had a little red blob to the left of the cursor. So some of that "lagginess" is intentionaly (although not all of it, due to vim limitations).

Cheers,
Kyle Moffett
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/