On 4/20/06, Silent1 <[EMAIL PROTECTED]> wrote:
> Also with folding, can i only create folds with when foldmethod is set
> to marker? I'm currently using the syntax method that folds pretty
> much everything i need but i also have some large blocks of code that
> are neither methods or classes.

You can create folds with a foldmethod of either 'manual' or 'marker'.
 When you switch from a foldmethod of 'syntax' to 'manual', all of
your syntax folds remain, so you could do:

:set foldmethod=syntax
:set foldmethod=manual

And then create the additional folds you need.  In order to persist
your manual folds, you'd need to use views.  You can look at the help
for :mkview, :loadview and 'viewoptions' for more information on that.

My guess is that this would become difficult to manage fairly quickly.
 You'd want newly written code to honor the syntax folding, but you
can't switch back to syntax folding without losing your manual folds. 
If you don't object to having fold markers in your code, you could use
syntax folding, but extend your syntax file with something like this:

:syn region foldMarker start='//{{{' end='//}}}' transparent fold

And then re-map the 'zf' command to insert those markers around the
desired range.  This would make it fairly easy to have a hybrid
between syntax folding and marker folding.

Reply via email to