Am 08.01.2013 09:33, schrieb Boris Danilov:
> 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
And the help topic is at
:h :syn-fold
I don't know why you insist on folding by syntax, it doesn't make sense
for your language (imho). The opening marker contained in the linewise
comment need to extend that comment over several lines up to the closing
marker, it's not one-line anymore.
And fdm=syntax is also known to be slow.
And you cannot create/delete folds with `zf', `zd' etc. but maybe that
is intended?
--
Andy
--
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
Tuesday, January 8, 2013
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment