Thus spake Eric Arnold on Sat, Apr 29, 2006 at 04:43:56PM -0600 or thereabouts:
<[EMAIL PROTECTED]> [2006-04-29 18:55]:
> Have you seen the "fold-expr" section?
>
> EXPR *fold-expr*
>
> The folds are automatically defined by their foldlevel, like with the
> "indent"
> method. The value of the 'foldexpr' option is evaluated to get the
> foldlevel
> of a line. Examples:
> This will create a fold for all consecutive lines that start with a Tab: >
> :set foldexpr=getline(v:lnum)[0]==\"\\t\
>
> It seems like you could adapt this to the comment style in your files.
>
> You could use the foldlevel() sorta like:
>
> let &foldexpr = 'getline(v:lnum)[0]=="#"'
>
> Fold all comments beginning with #
>
> g/.*/ if foldlevel(line(".")) > 0 | s/$/ !!!/ | endif
>
> Do something for each line that is folded
>
> Change s/$/!!!/ to delete if you want to delete the folded lines.
>
Thanks, Eric. There is a bit too much to it for me to investigate right
now. I'll save your suggestion for when I am ready to look into it
further.
cga