How to set the default to unfolded when you open a file?
set foldlevel=99
should open all folds, regardless of method used for folding. With foldlevel=0
all folded, foldlevel=1
only somes, ... higher numbers will close fewer folds.
You can put this in your .vimrc
:
au BufRead * normal zR
It declares an automatic command (au
), triggered when a buffer is read (BufRead
), matching all files (*
) and executes the zR
(opens all folds) command in normal mode.