vim: code folding


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


Leave a Reply

Your email address will not be published. Required fields are marked *