Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.

Colorscheme: Highlight color relative to color of text being highlighted?

0 votes
asked Sep 23, 2015 in vifm by anonymous

Instead of having a defined, static highlight color, it would be more useful to have the highlight color be the text's color. When highlighted, the text's color should match the background colors. This would guarantee that the text is always readable.

1 Answer

0 votes
answered Sep 23, 2015 by xaizek
Best answer

It depends on color scheme, inverting colors doesn't necessary guarantee good readability on its own. Anyway, it's easy to add such behaviour by specifying reverse attribute for CurrLine highlight group (might want to see related help). Like in the following line:

highlight CurrLine cterm=bold,reverse ctermfg=default ctermbg=blue
commented Sep 24, 2015 by anonymous


The reverse attribute yields more elegant results than a fixed color:
As long as the font color is readable on the background, it will (by definition) be readable when highlighted, which is clearly not true with vifm's current settings.

See how vifm's current highlighting compares to ranger's in terms of readability:


May I suggest changing the default colorscheme?

highlight CurrLine cterm=bold,reverse ctermfg=default ctermbg=default
commented Sep 24, 2015 by xaizek

You're right, I missed changing ctermbg=blue part and that's why it wasn't looking good.

I actually do use

highlight CurrLine cterm=bold,reverse ctermfg=default ctermbg=default

myself. Seems to be worth using it by default, thanks!

commented Jan 13, 2016 by anonymous

You could change it in the next release, if you haven't done it already.

commented Jan 13, 2016 by xaizek

I did the change in September, so it will be in 0.8.1.

If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.