Today I Learned

A Hashrocket project

Ready to join Hashrocket? Find Openings here and apply today.

Add visual fold markers to Vim's gutter

TIL that you can display visual fold markers in Vim’s gutter by setting the foldcolumn!

set foldcolumn=2

The number indicates how wide the gutter holding the fold marks should be.

Here it is in action:

demo

This also makes the folds openable via mouse, which may be useful for some folks.

For more info: :h foldcolumn

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.