Use zM to fold all code.
Use zR to unfold all code.
Use zo to unfold at the current cursor position.
Use zc to fold at the current cursor position.
Setting fold levels
You can set the fold level directly by entering
Add this line to your .vimrc to have the same behaviour whenever vim starts.