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

129449Re: creating syntax file - syn match problem

Expand Messages
  • Ben Fritz
    Mar 6 7:31 AM
    • 0 Attachment
      On Mar 5, 7:06 pm, Tarlika Elisabeth Schmitz
      <v...@...> wrote:
      > On Mon, 5 Mar 2012 07:49:50 -0800 (PST)
      >
      > Ben Fritz <fritzophre...@...> wrote:
      > >> This virtually does what I want:
      >
      > >> syn region  xyzCode matchgroup=xyzCodeMark start='{{{' end='}}}'
      > >> syn region  xyzCode matchgroup=xyzCodeMark start='{{{{' end='}}}}'
      >
      > >> with one exception:
      > >> When the code block is started with more than 3 braces, the opening
      > >> set of braces must be followed by [spaces] and a new line.
      >
      > >syn region  xyzCode matchgroup=xyzCodeMark start='{{{{\ze\s*$'
      > >end='}}}}'
      >
      > That's great, got that working, also thanks for the help links.
      >
      > Now, I have  been trying to match another, more complex
      > pattern but I don't know how to tackle it:
      >
      > [[foo:sometext|somename|someoption]]
      >
      > Not all of the elements are necessarily present.
      > I would like to colour teach text element differently and the markup
      > [[ : | | ]] in blue.
      >
      > foo: is optional
      > | somename is optional
      > | someoption is optional
      >
      > Is this a case for nextgroup?
      >

      I'd probably define a region from [[ to ]]. Depending on what the
      syntax actually is, you might be able to get away with just creating
      some contained groups and adding them to the contains= of the region.
      But nextgroup can be very useful, especially if the items need to come
      in some defined order.

      --
      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
    • Show all 9 messages in this topic