Different background color in Vim past 80 columns

Or any number of columns, but 80 seems to be the standard for code.

Preface

I’ve tried different ways of highlighting lines past 80 columns but was never satisfied with the results. Since Vim 7.3 there’s a nice colorcolumn option, but it just didn’t look any good:

Vim with :set colorcolumn=80

It’s not just the red color, which can be easily changed, but the whole “highlight a single seemingly random column” didn’t appeal to me. After searching for inspiration on Google, I found this StackOverflow question with the following screenshot of TextMate:

TextMate with “Highlight right margin” option

Well, well, that looks much prettier. Is it possible to get something similar in Vim?

Read the rest of this entry »

Advertisements
Posted in Vim. 7 Comments »