If you backtrack from your HTML, then the following should work:
set foldmethod=indent
The problem with this, I think there are too many folds. To get around this, I use zO and zc to open and close nested folds, respectively.
For more information, see help fold-indent :
The folds are automatically defined by the indent of the lines. The foldlevel is computed from the indent of the line, divided by the 'shiftwidth' (rounded down). A sequence of lines with the same or higher fold level form a fold, with the lines with a higher level forming a nested fold. The nesting of folds is limited with 'foldnestmax'. Some lines are ignored and get the fold level of the line above or below it, whichever is lower. These are empty or white lines and lines starting with a character in 'foldignore'. White space is skipped before checking for characters in 'foldignore'. For C use "#" to ignore preprocessor lines. When you want to ignore lines in another way, use the 'expr' method. The indent() function can be used in 'foldexpr' to get the indent of a line.
ihohbeto Jun 29 '13 at 21:20 2013-06-29 21:20
source share