In vim I am trying to have it highlight my screen when it goes over 80 characters (I am a kernel developer and this is a requirement for kernel code). I am using the following in my .vimrc file to do this
highlight OverLength ctermbg=red ctermfg=white guibg=#59292
match OverLength /\%81v.\+/
which was suggested here: Vim 80 column layout concerns
However, I am colorblind and as a result I cannot use the default colorscheme and see the text on the screen so I change my default colorscheme using :colorscheme torte as well. However, it appears that the colorscheme overrides the highlighting on me (it highlights fine when I don’t have the colorscheme specified, and doesn’t when it is specified).
Does anyone have any ideas on how to make this work with the colorscheme change? Thanks for your help,
That’s because most color schemes have this line in their beginning:
This clear all highlighting groups created (you created
OverLength). This is good, because no colorscheme has every thing set, and colors from the previous scheme used could remain appearing.To solve, instead of creating a new group, match this pattern as
Errorwhich is a default Vim group, will be present in every color scheme. Change your two lines by one simply: