To enable code folding in Vim type (from normal mode):

:set foldmethod=marker

Or add this to your .vimrc

set foldmethod=marker

Now anything contained with in \{\{\{ and \}\}\} will be folded.

Commands

From Normal mode

unfold zo (open)
fold zc (collapse)
unfold all zr
Fold all zm

Read more on vim wiki