Vim has a handy feature in :syntax sync fromstart
which allows me to fix syntax highlighting when it gets confused during an extended editing session. I map it to <leader>ss
(reSync from Start) because I use it so often.
How would I achieve the same effect with code folding that uses a fold expression? From time-to-time, especially when commenting out areas of code, the folds will get out of sync with the actual buffer contents, and I'd be more than happy to wait the fraction of a second it would take Vim to recalculate the folds from scratch.
I'm happy for a short script if that's what it would take. I'm developing my vimscript-fu and would be happy for the exercise :)