How to collapse or expand source code in vim?

2

2

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.

Jichao

Posted 2010-09-11T06:03:54.070

Reputation: 5 245

4For 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 – 2011-11-21T20:10:09.220

Answers

3

: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.

akira

Posted 2010-09-11T06:03:54.070

Reputation: 52 754