I'm using the awesome spf13 Vim distribution,
when I open a code file I find collapsed all the blocks,
so I usually do a zE
to expand all the blocks,
beacuse I like that way ..
is there some trick to do this automatically on every file?
This behavior is controlled by the 'foldlevelstart'
option. The default is -1
(inactive); probably your distribution set it to 0
.
You can overwrite this to always open all folds via
:set foldlevelstart=99
Usually this is done in the ~/.vimrc
, but there may be different rules for the spf13 distribution. Vim "distributions" like spf-13 and Janus lure you with a quick install and out-of-the-box settings, but you pay the price with increased complexity (you need to understand both Vim's runtime loading scheme and the arbitrary conventions of the distribution) and inflexibility (the distribution may make some things easier, but other things very difficult). Vim is incredibly customizable, using someone else's customization makes no sense.
zE
does not open all folds (that's zR
), it eliminates them, so there's no way back (and it only works for certain fold methods at all). If you don't want folding at all, turn it off via :set nofoldenable
.