Loading ...
Sorry, an error occurred while loading the content.
 

Re: No way to color-region(s) of text -- highlighter mode.

Expand Messages
  • A.J.Mechelynck
    ... In Vim 7, you can have up to three matches (using :match, :2match and ... when the cursor is on a bracket, to show you its mate. Or, to highlight the
    Message 1 of 32 , Aug 4, 2006
      Mohsin wrote:
      > I already tried your solution, it only works for a single region at a time
      > On applying the same higlighting to second region and the first one is
      > un-highlighted.
      >
      > 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.

      In Vim 7, you can have up to three matches (using :match, :2match and
      :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
      double quotes.

      see ":help pattern.txt"


      Best regards,
      Yony.
    • Nikolai Weibull
      ... [Vince Negri s conceal patch] ... Well, the point is that you, as a user using this feature, has to be aware of this. It s the same with rm -rf / , if
      Message 32 of 32 , Aug 7, 2006
        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.
        > When doing line wise concealing you will never now (with exception of
        > :se number) if there are hidden lines.

        Well, the point is that you, as a user using this feature, has to be
        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.

        nikolai
      Your message has been successfully submitted and would be delivered to recipients shortly.