Malik Fassi
Malik Fassi

Reputation: 488

vim : Highlight tab with one color and spaces with another ?

How can I highlight tabs with one color and spaces with another in vim ?

I know how to highlight only tabs or only spaces. And I don't know how to select the colors separately for both spaces and tabs.

Upvotes: 2

Views: 2848

Answers (1)

Randy Morris
Randy Morris

Reputation: 40927

A simple solution would be to do something like:

:match Error /\t/
:2match Todo / /

Where Error and Todo are highlight groups from :highlight. This is going to take up two of your three matches and will only be temporary.

Theoretically you could use matchadd() or a combination of highlight groups and :syntax match commands in your .vimrc to make this more permanent but your question doesn't really specify if that's what you want.

Upvotes: 9

Related Questions