Add visual fold markers to Vim's gutter

January 06, 2020

  • vim

Originally posted by me on Hashrocket TIL

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


Written by Dorian Karter, a Sr. Software Engineer
Github | Twitter

© 2021, Dorian Karter