I like folding with indent but including the comments in the fold (I mean each comment get the same level of fold as the previous line).
Unfortunately, foldignore keyword just works for one line comments. So I fold with expr in vimrc:
"get string of current line
" check if empty line
if empty(crLine) "Empty line or end comment
return -1 " so same indent level as line before
" check if comment
let a:data=join( map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")') )
if a:data =~ ".*omment.*"
"Otherwise return foldlevel equal to indent /shiftwidth (like if
else "return indent base fold
The last block :
Returns a foldlevel base on indent.
And the other one :
join( map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")') )
Checks if the first character of the line is consider as a comment with the syntax. So it is a good way to merge indent and syntax folding with expression, the most advanced folding.
Note that you can also "set foldtext" depending on how you want the result to look like.