vim fold/unfold all

set foldmethod=indent

use zo and zc to fold and unfold in normal mode
use zR and zM to fold and unfold all folds

zo Open one fold under the cursor. When a count is given, that
many folds deep will be opened. In Visual mode one level of
folds is opened for all lines in the selected area.

zc
zc Close one fold under the cursor. When a count is given, that
many folds deep are closed. In Visual mode one level of folds
is closed for all lines in the selected area.
‘foldenable’ will be set.

Leave a Reply

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