My syntax file looks like the following

syntax match Lev1 /^- .*{{{1/
syntax match Lev2 /^-- .*{{{2/    etc

of course once I change foldmethods I'll remove the {{{# part

On Tue, Nov 11, 2008 at 8:43 AM, Tim Chase <[EMAIL PROTECTED]> wrote:
>
>> I currently use foldmethod=marker with the standard markers {{{#.
>> However since I start all my folds with  a - with # of dashes
>> indicating the level i.e.
>>
>> - level 1
>> -- level 2
>> --- level 3,  etc
>>
>> Can use syntax folding instead since I already have a syntax file
>> setup for highlighting? And how would I do that?
>
> To fold based on that definition, you can use
>
>   :set foldmethod=expr
>   :set foldexpr=strlen(matchstr(getline(v:lnum),'^-*'))
>
> Without knowing the contents of your syntax file, it's a bit hard
> to determine how a foldmethod=syntax verions might be folded (pun
> intended) into your syntax highlighting specification.
>
> -tim
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to