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:
set foldmethod=expr
set foldexpr=FoldMethod(v:lnum)
function! FoldMethod(lnum)
"get string of current line
let crLine=getline(a:lnum)
" check if empty line
if empty(crLine) "Empty line or end comment
return -1 " so same indent level as line before
endif
" check if comment
let a:data=join( map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")') )
if a:data =~ ".*omment.*"
return '='
endif
"Otherwise return foldlevel equal to indent /shiftwidth (like if
"foldmethod=indent)
else "return indent base fold
return indent(a:lnum)/&shiftwidth
endfunction
The last block :
indent(a:lnum)/&shiftwidth
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.