Hi
Is it possible to make syntax folding could fold the following text:

! Level 1
blablabla
blablabla

!! Level 2
blablabla
blablabla
blablabla

!!! Level 3
blablabla
blablabla
blablabla

!!! Level 3
blablabla
blablabla
blablabla

!! Level 2
blablabla
blablabla
blablabla

! Level 1
blablabla
blablabla
blablabla

into:
+-- 23 lines: ! Level 1----------

+-- 4 lines: ! Level 1----------

With all levels folded according to count of exclamation marks.

For level1 folding I have the next command:
:syntax region level1 start=/^![^!]\+.*/ end=/\n\+\ze![^!]\+.*/
transparent fold

For level2 folding the similar command doesn't work (region should
start at double ! and end at double or single !):
:syntax region level2 start=/^!![^!]\+.*/ end=/\n\+\ze!!\?[^!]\+.*/
transparent fold

Why the last command does wrong folding?
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to