-
-
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
Custom fuzzy completion for commands that are not first in the pipeline ($LBUFFER) #4074
Comments
It does work correctly in command env -i HOME=$HOME TERM=$TERM USER=$USER PATH=$PATH bash --norc
eval "$(fzf --bash)"
_fzf_complete_doge() {
_fzf_complete --multi --reverse --prompt="doge> " -- "$@" < <(
echo very
echo wow
echo such
echo doge
)
}
complete -F _fzf_complete_doge -o default -o bashdefault doge
[cmd1] | doge ** In zsh, the issue lies in the Lines 123 to 135 in d938fdc
As a workaround, you could try using # process substitution
paste -sd "," <(seq 15 -5 1)
# 15,10,5
# process substitution with redirection
paste -sd "," - < <(seq 15 -5 1)
# 15,10,5 PS: Your reported issue is still valid, don't close it. |
Based on the description from OP, I didn't search for other tickets until I clicked on the |
@LangLangBart Oh, thanks for pointing it out. |
Checklist
man fzf
)Output of
fzf --version
0.56.0 (ff16877)
OS
Shell
Problem / Steps to reproduce
This must have been discussed somewhere during the fzf history, but I can't seem to find any relevant issues or a clear statement that it's not possible in man or on github or wiki (https://github.com/junegunn/fzf/wiki/Examples-(completion)#writing-custom-fuzzy-completion) 😞
I'm trying to make a custom completion for
llm
command to complete available LLM models:A naive handler is simply not triggered:
or to be more precise, instead, git handler is triggered (which I have a custom handler for):
so it looks like everything that has to do with that type of completion works under the assumption that the command we're completing is the first one? So how can I have a handler for command that is not the first one in the pipeline? Is that possible at all?
I guess I could in that specific case override my git handler, make it more smart at parsing the whole line and check where the "cursor" is, but what if it's a different command I don't have a handler for, e.g.:
The text was updated successfully, but these errors were encountered: