Thursday, March 1, 2012

creating syntax file - syn match problem

I have created a syntax file for a markup language.

Below I have given examples of inline and multi-line code blocks.

I would like to highlight the text between the set of curly braces and
highlight the the curly braces in a different colour.

My attempt below doesn't work: it causes the remainder of the document
to be highlighted in the code xyzCode colour.

Any help with this would be greatly appreciated.

SYNTAX FILE:
============

syn match xyzCodeMark contained "{{{"
syn match xyzCodeMark contained "}}}"
syn region xyzCode start='{{{'hs=s+3 end='}}}'he=e-3
contains=xyzCodeMark

hi link xyzCodeMark Function
hi link xyzCode String


EXAMPLE:
========

an inline {{{code}}} example

{{{
a block code
}}}

{{{
another block code
}}}
--

Best Regards,
Tarlika Elisabeth Schmitz

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