Aloxaf / fzf-tab

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

[Q] Using `FZF_DEFAULT_OPTS`. #475

Closed pablospe closed 1 month ago

pablospe commented 1 month ago

After this commit: 0b49f3e8a3fdb546636ff2157925d32e8936b415 (fix: always ignore FZF_DEFAULT_OPTS) How do you set to actually use FZF_DEFAULT_OPTS, if one wants to?

PrayagS commented 1 month ago

+1. Dumping all my flags in fzf-flags has no effect for some reason.

Can this be turned into an optional behavior? Default can be to ignore FZF_DEFAULT_OPTS. Happy to open a PR if that sounds good.

pablospe commented 1 month ago

Can this be turned into an optional behavior? Default can be to ignore FZF_DEFAULT_OPTS. Happy to open a PR if that sounds good

If you know how to do it, please create a PR. I think few people will benefit from it, even if it is not merged in main. I understand the reason why to ignore FZF_DEFAULT_OPTS, but it also creates a usability problem (at least it is not document properly, as far as I understand, perhaps it is an easy fix).

PrayagS commented 1 month ago

If you know how to do it, please create a PR. I think few people will benefit from it, even if it is not merged in main.

Opened the PR: https://github.com/Aloxaf/fzf-tab/pull/479

I understand the reason why to ignore FZF_DEFAULT_OPTS, but it also creates a usability problem (at least it is not document properly, as far as I understand, perhaps it is an easy fix).

It was documented recently from what I see. https://github.com/Aloxaf/fzf-tab/blob/cf57116eb2410139b8bd78fcb793dd84db79e28f/README.md?plain=1#L118-L119

The issue I saw with using fzf-flags is that most users of this plugin also use https://github.com/Freed-Wu/fzf-tab-source/ which overrides the value of fzf-flags. The final value of fzf-flags that I was seeing in my shell wasn't showing up as expected.

If someone is not using that plugin, I suppose fzf-flags should work directly without needing this patch.

Aloxaf commented 1 month ago

You can use FZF_DEFAULT_OPTS by this:

zstyle ':fzf-tab:*' fzf-flags ${(z)FZF_DEFAULT_OPTS}
pablospe commented 1 month ago

Thanks for the answer, @Aloxaf! Unfortunately, this didn't work for me, see this comment: https://github.com/Aloxaf/fzf-tab/pull/479#discussion_r1791920144