Tuesday, January 8, 2013

Re: A question on folds syntax definition

Am 07.01.2013 19:29, schrieb Boris Danilov:
> Hello! I have a language with one-line comments that start from '//'
> (double slash) and last to the end of the line. I want to
> syntactically define folds that start with '//>' and end at '//<'.
> Folds can nest. It looks simple, but I can't come up with a good
> solution.

Okay, if anybody interested I did it like this and pretty satisfied
with the result.

syntax region langCommentLine start="//" end="$"
syntax region langFold start="//>"
\ end="//<.\{-}\(\(//>\)\@=\|\(//<\)\@=\|$\)"
\ keepend extend
\ contains=TOP transparent fold

Regards,
Boris

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