Aloxaf / fzf-tab

Replace zsh's default completion selection menu with fzf!
MIT License
2.98k stars 90 forks source link

[Q] How can I let fzf-tab use these configs I set for fzf #446

Closed marsjane closed 3 weeks ago

marsjane commented 1 month ago

Describe your question A clear and concise description of your question. I already set my own fzf well. with some configs like FZF_COMPLETION_OPTS FZF_DEFAULT_COMMAND and fzf_preview_cmd, I can see that it do well when I use the fzf command directly, all preview shows fine. But when I am using tab to trigger the fzf-tab, it seems not using any configs from my fzf.zsh config file, and there is no preview. Is it possible to let fzf-tab use my fzf config? Here is my fzf.zsh

#!/usr/bin/env zsh
export FZF_COMPLETION_OPTS='--border --info=inline'
export fzf_preview_cmd='[[ $(file --mime {}) =~ binary ]] && echo {} is a binary file || (bat -p --style numbers --color=always ) 2> /dev/null | head -500'
# fzf-tab
zstyle ':completion:*' menu no
zstyle ':fzf-tab:*' fzf-command fzf
zstyle ':fzf-tab:*' fzf-bindings 'space:accept'
eval "$(fzf --zsh)"

Is there anything I do wrong?

Aloxaf commented 3 weeks ago
zstyle ':fzf-tab:*' fzf-flags ${(z)FZF_COMPLETION_OPTS}