man fzf)That would be great if I could set the background of highlights, not just their foreground. I'm experimenting with colorful (--ansi) inputs and I found that there is no good setting for hl.
Hi @zsugabubus, isn't this more of a feature request for highlight or the program you use for previewing things?
UPDATE: Actually, in version 0.20.0, there is an option to set a colour to the background:
fzf --preview 'cat {}' \
--color 'fg:#bbccdd,fg+:#ddeeff,bg:#334455,preview-bg:#223344,border:#778899' \
--border --height 20 --layout reverse --info inline
From: https://github.com/junegunn/fzf/blob/master/CHANGELOG.md
Thanks for the feedback. I鈥檓 talking about highlightings of searched substrings. You can set their foreground using hl or hl+ but as I said, sometimes it would be more suitable if you could set their background (too). I usually match fancy colored lines, so these highlights get lost in the rainbow. I could achieve greater contrast with this option.
Still no color option for background, but since 0.24.0, you can set reverse attribute which might suit your needs.
# Apply reverse attribute
rg --line-number --no-heading --color=always "" |
fzf --ansi --color hl:reverse,hl+:reverse
# -1 means keeping the original foreground color
rg --line-number --no-heading --color=always "" |
fzf --ansi --color hl:reverse:-1,hl+:reverse:-1
Thanks a lot, looks great!
(Though the issue is not _exactly_ about it I'm satisfied with the result, so you can close it if you would like to.)