Today I Learned

hashrocket A Hashrocket project

Vim collapse/expand code

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

To enable that we need to set foldmethod:

set foldmethod=indent
set foldlevel=5

To toggle code collapse/expand just use: za.

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