Loading...

Highlight lines in vim

:heavy_exclamation_mark: This post is older than a year. Consider some information might not be accurate anymore. :heavy_exclamation_mark:

To highlight lines that exceed more than 80 characters, we can colorize the extraneous characters.

Add to your ~/.vimrc

highlight OverLength ctermbg=darkred ctermfg=white guibg=#FFD9D9
augroup vimrc_autocmds
    autocmd!
    autocmd BufEnter,WinEnter * call matchadd('OverLength', '\%>80v.\+', -1)
augroup END

Every line which is longer than 80 characters will result in: Lines gt 80

vi
Please remember the terms for blog comments.