-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it possible to disable Ctrl+T
/ Alt+C
/ completions
#3678
Conversation
This makes it possible to skip one of the above key bindings or completions by setting a variable to an empty string. For example, FZF_CTRL_T_COMMAND= FZF_ALT_C_COMMAND= FZF_COMPLETION_TRIGGER= \ eval "$(fzf --zsh)" would leave only the history search. Makes it more convenient then producing the files and changing them myself to not include what I don't want. This should be working, but for completeness it should also include at least some explaining comment at the top (since there's no docs about these vars?) and something equivalent for bash/fish.
Can you update those files as well? |
Bash would be easy, but I don't have experience with fish so it'd need to wait until I have time to do it properly... |
Yeah, I kind of felt the same. But the idea of disabling a key binding if its COMMAND variable is intentionally set to an empty string doesn't seem too far-fetched and it's the simplest approach at hand. So I'm going to accept it. The limitation of this approach though is that it doesn't address the need of some users to bind the feature to a different key. But it's not easy to come up with a solution that works consistently with all 3 shells because they all use different key expressions. I'll take over this PR from here and finish it up (bash, fish, and documentation). Thanks. |
Merged, thanks! |
@junegunn Huge thanks for taking it over! Some replies that are the least I owe you:
|
So what was your motivation behind this? Which feature did you want to opt-out? I decided to make
That would be ideal, but I wanted the variables to work consistently across three different shells to minimize the confusion, but it's not easy to achieve that with the approach because all three shells use different key expressions. |
Maybe I am not "most users" but I certainly wish fine grain control over the scripts. We are not quite there yet (from what I can see). In the old mechanism there existed separate In the new mechanism Ideally I would like something like: FZF_COMPLETION= eval "$(fzf --bash)" I do want |
I just saw
Compared with old-school time . $HOMEBREW_PREFIX/opt/fzf/shell/key-bindings.bash
real 0m0.004s 29ms vs 4ms. It would be nice to have true opt-out of Bash fzf |
That part was not merged.
eval "$(fzf --bash | sed '/### completion/,$d')"
You don't have to use |
Thanks @junegunn, I assume that the the scripts on-disk will eventually go away? I am satisfied. |
Oh, the scripts will always be available, if so, then I will stick with those. All good, sorry for the diversion. |
No problem, thanks for sharing your case. |
This makes it possible to skip one of the above key bindings or completions by setting a variable to an empty string. For example,
would leave only the history search. Makes it more convenient then producing the files and changing them myself to not include what I don't want.
This should be working, but for completeness it should also include at least some explaining comment at the top (since there's no docs about these vars?) and something equivalent for bash/fish.