Posted by Dariusz Dwornikowski on Sat 02 February 2013

Highlight lines over 79

If you want to stick to PEP8 speccification of Python syntax, you should stick to 79 line length. It is very easy to forget to follow that rule, fortunatelly vim can help you. There are many nice solution to inform you when you go past 79 column. The most generic one is highlighting only the 80th column by setting set cursorcolumn (or just set cc). This will produce a vertical line on the column according to your textwidth variable. You can check this by doing :set tw?. If you want some better looking solution try the one I found on stackoverflow. You can adjust the color and linewidth to your preferences.

highlight OverLength ctermbg=red ctermfg=white guibg=#592929
match OverLength /\%80v.\+/

© 2012-2014 Dariusz Dwornikowski. Built using Pelican. Based on theme by Carey Metcalfe, available on GitHub, which is based on svbhack by Giulio Fidente, modified by Vincent Cheng.