This answer is more of a hack than a real solution to your question.
From the text you show, it seems you may rely on indentation for your folding.
If so, you can use set foldmethod=indent.
A little function I use in such case:
~/.vim/view is a default value (under *nix) for :h 'viewdir' option, which, in turn, is used by the :h :mkview and :h :loadview commands.
:mkview is a rarely used :mksession-like command which saves some settings of a single window/view.