tommcdo / vim-exchange

Easy text exchange operator for Vim
MIT License
756 stars 23 forks source link

Add option to set custom colors #46

Closed PetarMetodiev closed 5 years ago

PetarMetodiev commented 5 years ago

Is it possible to expose some kind of variable for setting custom color or is there any other way to do that?

I am not familiar with vimL, so sorry if this comes as a stupid question.

Thanks

tommcdo commented 5 years ago

Hello!

Exchange.vim defines a highlight group called ExchangeRegion. By default, it's linked to the IncSearch highlight group (this is just a convenience; I didn't want to choose colors that might clash with people's color schemes), meaning it will look the same as search terms when have incremental search turned on. This can be overridden.

You can take a look at :help :higlight to go in-depth (though it's not a very pleasant read). In summary, you can do things like this:

highlight ExchangeRegion ctermfg=red guifg=#ff0000

to change the text color to red; or

highlight link ExchangeRegion Comment

to use the same highlighting as comments.

Hope that's helpful!