Closed idevat closed 1 year ago
Are you sure fzf-tab respects FZF_DEFAULT_OPTS? I think you need to set the fzf-flags style instead.
I'm extremely confused actually because after I posted this, I saw that it's the fzf binary itself which documents FZF_DEFAULT_OPTS. So, by default anything that ultimately uses the fzf binary ought to respect those arguments. So I thought I was right about your issue. But then I just tested it locally and indeed I see that FZF_DEFAULT_OPTS is not being respected. I guess the authors of fzf-tab preferred to avoid this global completely in favor of zstyle.
You can force fzf-tab to accept the default opts by doing
zstyle ':fzf-tab:*' fzf-flags $(echo $FZF_DEFAULT_OPTS)
I do this in my setup because ultimately, since the default options are used widely, all that FZF_DEFAULT_OPTS ends up containing is colors and the matching style (-e).
Thank you @quicknir for explanation and solution! I confirm that your solution works.
@idevat okay, the full answer is even more complicated. fzf-tab does respect FZF_DEFAULT_OPTS, but it surrounds the value in the shell that tmux was launched from. not in tmux itself. So, if you want to see the change in FZF_DEFAULT_OPTS, and you, like me are currently editing your zsh environment files inside tmux, you need to:
Launch tmux. Now you should observe fzf-tab respecting FZF_DEFAULT_OPTS.
I'm guessing that like me, you simply edited your zshrc, opened a new tmux tab, and then observed that fzf-tab wasn't respecting it. It's because it takes its value from the outside. fzf itself I think is more careful in the implementation of fzf-tab and properly forwards this env var.
Describe the bug
Color of highlighted characters (on not selected line - i.e.
hl
) does not respect settings for fzf and it is highlighted with unreadable color. See screenshot (fzf-tab on left side with gray characters and standalone fzf on right side with red characters)I can make sure:
compinit
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The color of highlighted characters are the same as in standalone fzf.
Screenshots
Environment:
Minimal zshrc