Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to collapse or expand source code in vim on HTML, PHP, etc?

EDIT: I know the basic folding command but what I need is something much more advance and intelligent such as in Visual Studio. I think it could not help without some really good plugin.

share|improve this question
For reference, the basic folding commands in vim are zf{motion} to create a fold, zo to open a fold, and zc to close a fold. – Kristo Nov 21 '11 at 20:10

:help foldcolumn will tell you about how to create a small area left of the text that contains some controls to fold and unfold.

read about :help foldmethod about how to create folds automatically, eg. :set foldmethod=syntax.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .