How do I link highlighting groups in a vim colour scheme?

1.5k views Asked by At

I'm trying to clean up a colour scheme that I'm making for vim by linking some highlighting groups but I can't get the linking to work.

Here is a sample of my vim script:

highlight Error            ctermbg=161
highlight link ErrorMsg    Error

The ErrorMsg still has the default background colour.

1

There are 1 answers

1
ryanpattison On BEST ANSWER

Make sure you're clearing the settings for ErrorMsg before the link, otherwise the link will fail.

highlight Error            ctermbg=161
highlight ErrorMsg         NONE
highlight link ErrorMsg    Error