I'm using the code suggested here in my vimrc to highlight lines over 80 columns.
highlight OverLength ctermbg=gray ctermfg=white guibg=#592929
match OverLength /\%81v.\+/
This works great for code-related files, but it's annoying for me in markdown. Is there a way to turn off highlighting by file type in my vimrc?
To turn off the highlighting for the markdown filetype, add the following to your ~/.vimrc:
autocmd FileType markdown match none
This turns off the :match highlighting for that filetype.
(Alternatively, I would recommend putting that into ~/.vim/after/ftplugin/markdown.vim instead of defining lots of :autocmd FileType {filetype}; this requires that you have :filetype plugin on.)
Note that :match is window-local, so your original code already has issues when working with window splits and switching buffers; this solution inherits this.
Also note that there is 'colorcolumn' built-in in Vim 7.3+.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With