How to fold/unfold HTML tags with Vim

nsbm picture nsbm · Aug 22, 2011 · Viewed 24.6k times · Source

Is there some plugin to fold HTML tags in Vim?
Or there is another way to setup a shortcut to fold or unfold html tags?
I would like to fold/unfold html tags just like I do with indentation folding.

Answer

James Lai picture James Lai · Sep 12, 2012

I have found zfat (or, equally, zfit) works well for folding with HTML documents. za will toggle (open or close) an existing fold. zR opens all the folds in the current document, zM effectively re-enables all existing folds marked in the document.

If you find yourself using folds extensively, you could make some handy keybindings for yourself in your .vimrc.