Re: No way to color-region(s) of text -- highlighter mode.
- Mohsin wrote:
> I already tried your solution, it only works for a single region at a timeIn Vim 7, you can have up to three matches (using :match, :2match and
> On applying the same higlighting to second region and the first one is
> Try this (the third command will unhilight the first region):
> :highlight User1 term=bold cterm=5 guibg=red
> match User1 /\%>54l.\%<78l\&\%>14v.\%<39v/
> match User1 /\%>84l.\%<88l\&\%>14v.\%<39v/
> - mohsin.
:3match). Note, however, that :3match is used by the matchparen plugin
when the cursor is on a bracket, to show you its mate. Or, to highlight
the matches in a single colour, you could concatenate the patterns with
\| (meaning "or"):
:match User1 /\%>54l.\%<78l\&\%>14v.\%<39v\|\%>84l.\%<88l\&\%>14v.\%<39v/
(one long line). If this becomes too long to look at easily in a script,
you can use continuation lines (if 'nocompatible' is set):
exec 'match User1 /'
\ . '\%>54l.\%<78l\&\%>14v.\%<39v\|'
\ . '\%>84l.\%<88l\&\%>14v.\%<39v/'
or even "simplify" the expression logically:
:match User1 /\%(\%>54l.\%<78l\|\%>84l.\%<88l\)\&\%>14v.\%<39v/
Note the use of single quotes because the \ has special maning inside
see ":help pattern.txt"
- On 8/7/06, Mikolaj Machowski <mikmach@...> wrote:
> Dnia poniedziałek, 7 sierpnia 2006 15:46, Charles E Campbell Jr napisał:[Vince Negri's conceal patch]
> This works only on character wise collapsing and also isn't perfect.Well, the point is that you, as a user using this feature, has to be
> When doing line wise concealing you will never now (with exception of
> :se number) if there are hidden lines.
aware of this. It's the same with "rm -rf /", if you know what you're
doing, it's fine, but if not it's a disaster. The conceal patch is a
lot safer, however, as you'd be able to control the concealment,
whereas "rm -rf /" is a bit more volatile.