On Oct 8, 8:31 am, yosi izaq <[email protected]> wrote:
> On Thu, Oct 8, 2009 at 2:27 PM, Paul  wrote:
>
> >> I would like to apply the most simple directive to fold all the file
> >> so that each item (->) would be closed.
>
> > set foldmethod=indent ?
>
> Doesn't get the job done. The bullets are indented but I'm too lazy to
> indent the text so the file looks like:

Does this do what you want?
syn region Lvl1 start=/^\s*-\{1}>/ end=/^\s*-\{1}>/me=s-1
contains=Lvl2,Lvl3,Lvl4 fold
syn region Lvl2 start=/^\s*-\{2}>/ end=/^\s*-\{1,2}>/me=s-1 contained
contains=Lvl3,Lvl4 fold
syn region Lvl3 start=/^\s*-\{3}>/ end=/^\s*-\{1,3}>/me=s-1 contained
contains=Lvl4 fold
syn region Lvl4 start=/^\s*-\{4}>/ end=/^\s*-\{1,4}>/me=s-1 contained
fold
set foldmethod=syntax

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

Reply via email to