How do I create folds such that it starts at matched
expression and ends at the line containing part of the matched
expression. e.g i'd like to fold
procedure xyz ( .....
:
:
end xyz;
function abc (
:
:
end abc;
impure function pqr (
:
:
end pqr;
You might be able to do something like
:g/^\(procedure\|function\|impure function\)/.,/^end\>/fold
You can tweak that initial regexp to catch what you want.
If you can mix and match directives, you can do things like
/^\(impure \|pure \)\=\(procedure\|function\)/
which would find "procedure" or "function", optionally preceeded
("\=")by "pure" or "impure". A bit contrived, but you can riff
on this theme to get all sorts of permutations.
HTH,
-tim