Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
vim: enable folds but don't automatically close them

Whenever I open Vim, it automatically folds everything. So the first thing I invariably do is to unfold everything.

Is there a way to automate this?

share|improve this question

marked as duplicate by 8088, Nifle, Sathya May 3 '11 at 14:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

up vote 5 down vote accepted

To unfold all folds, use the keys

zR

In order to adjust the initial fold level, play around with the foldlevel, e.g.

:set foldlevel=1

will open all the highest level folds, a very high number will thus open all folds. Find out which level 1, 2, 3, ... is the one you want.

To make this static, edit your ~/.vimrc and add:

set foldlevelstart=1

dublicate of this question.

share|improve this answer
    
In case someone is wondering how to fold all folds: zM –  Jayaram Pai Oct 4 at 22:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.