Today I Learned

A Hashrocket project

Vim collapse/expand code

Today I learned to collapse/expand code in VIM using the indentfold strategy.

To enable that we need to set foldmethod:

set foldmethod=indent
set foldlevel=5

To toggle code collapse/expand just use: za.

Every developer at Hashrocket is a Vim expert. Check out our development environment, Dotmatrix, and if you are in Chicago, come to the monthly Vim Chicago Meetup hosted at our Chicago office.