I have a long code file with syntax folding in Vim.
I know how to open all folds (zR) or close all folds (zM), and I know how to increase or decrease the foldlevel (zm,
As Karl says, the foldnestmax setting is probably what you want.
foldnestmax
zO (i.e., capital-letter-o) opens all nested folds.
zO
I also find zx and zv very helpful.
zx
zv
When I use foldmethod=expr with a custom fold expression, I'll often modify the expression so that it only folds what I want it to fold.
foldmethod=expr