Im not sure if this idea might help, but I faced a similar problem in folding blocks of text within email digests like that for vim_use. And I did not have the stomach for fancy, script-based folding strategies. So I discovered something simple. Here is a fold for blocks of text that appear within vim_use digests:

1s/^.*$/Topic: ^M&/
        g/^Topic: */,/^Topic: *\|\%$/-1fold

Each fold gets applied to a block that starts with Topic: and ends with the line just before the next occurrence of Topic: This is similar to your sections.

For the last fold, it ends at the file's last line, %$. I then insert a line with Topic:, as the file's first line to ensure all blocks have a beginning and end. Very simple, but works like a charm. However, sounds like you want fold to happen dynamically as you type and edit?


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

Reply via email to