How to visually highlight long lines in Vim

October 1, 2019

I couldn’t find this documented somewhere and I had to do some reading before figuring it out myself, so I might as well document it here. What I’m talking about is the feature in Vim that let’s you visually highlight long lines.

You can manually enable it with the command :set colorcolumn=<Value> and it will work for that session. But manually enabling it or statically enabling it wasn’t any options either, I only wanted to enable it for Bash- and Python-files and after some reading I figured it out:

au BufWinEnter *.sh,*.py set colorcolumn=80


No Comments

Use the e-mail form, if you wish to leave feedback for this post. Markdown is supported. [Terms of service]