How to show colorcolumn only in insert mode of Vim

I like to have the colorcolumn enabled in Vim. I use it as a guideline to remind me when my code line is too long or nesting is too deep. As such, it is useful only in insert mode and is distracting the rest of the time.

To show colorcolumn only in insert mode, add this to your vimrc:

The number assigned to colorcolumn is the column at which the guideline is drawn. 0 means no guideline is displayed.

Tried with: Vim 7.3 and Ubuntu 12.04 LTS

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s