Tag Archives: .vimrc

vim: code folding

Folding/unfolding

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

:set foldlevel=1

Add this line to your .vimrc to have the same behaviour whenever vim starts.
set foldlevelstart=1