preservim / vim-indent-guides

A Vim plugin for visually displaying indent levels in code
MIT License
2.62k stars 162 forks source link

Automatically reset guides on shiftwidth change #116

Closed harendra-kumar closed 7 years ago

harendra-kumar commented 8 years ago

Different files may have different indentation levels and often times one has to manually set the shiftwidth to match the style of the file. It will be nice if guides can change automatically as soon as the shiftwidth is set.

Currently I toggle guides twice to reflect the change after setting shiftwidth.

Coacher commented 7 years ago

Add autocmd OptionSet * call indent_guides#process_autocmds() to your .vimrc.

harendra-kumar commented 7 years ago

Thanks! My vim does not seem to have OptionSet, will try a newer version of vim. But it seems this should work.

Coacher commented 7 years ago

You need vim >= 7.4.786

nathanaelkane commented 7 years ago

Thanks @Coacher that's handy to know, might add that in a future version.