1. Fold all lines in a file that contain only comments.

I think some others on the list posted some ideas here--particularly the syntax-folding.

You don't mention what language you're using...the syntax definition may already provide it. Alternatively, you might be able to make a foldexpr or manual folding one-liner to create the folds for you.

2. Optionally delete all the lines that have previously been folded.

You might try opening all your folds with "zR", and then doing something like

        :folddoopen d

(or close all your folds with "zM" and then use "folddoclosed" instead of "folddoopen")

You can read more at

        :help :folddoopen
        :help zM
        :help zR

(all within a few lines of each other)

-tim




Reply via email to