Skip to content
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

breaks fzf kill/ssh/.. completion #46

Closed
ztNFny opened this issue Jun 6, 2020 · 11 comments
Closed

breaks fzf kill/ssh/.. completion #46

ztNFny opened this issue Jun 6, 2020 · 11 comments
Labels
bug Something isn't working

Comments

@ztNFny
Copy link

ztNFny commented Jun 6, 2020

fzf has some special completions defined (see completion.zsh), e.g. for "kill -9 [TAB]" it uses ps to list the processes. With zsh-autocomplete that list is broken.

@ztNFny ztNFny added the bug Something isn't working label Jun 6, 2020
@marlonrichert
Copy link
Owner

@ztNFny I cannot reproduce this. kill -9 followed by fzf-completion looks identical to me with and without zsh-autocomplete. Can you please update and try again? This might have been fixed already in 3980bb7.

@ztNFny
Copy link
Author

ztNFny commented Jun 7, 2020

@marlonrichert I'm on the latest version already.
With zsh-autocomplete:
image
Without:
image

I can repoduce that with a minimal .zshrc:

source "$HOME/.zinit/bin/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
zinit ice pick"shell/key-bindings.zsh" src"shell/completion.zsh"
zinit light junegunn/fzf
zinit light marlonrichert/zsh-autocomplete

@marlonrichert
Copy link
Owner

marlonrichert commented Jun 7, 2020

Ah, now I see. It's not broken. It's working as intended. When you press Tab with zsh-autocomplete, it never uses fzf. 🙂

If you want to use fzf's completion with zsh-autocomplete, you need to press CtrlSpace. Please see the Readme: https://github.com/marlonrichert/zsh-autocomplete/blob/master/README.md#with-fzf

Try it: Type kill -9 and press CtrlSpace. You'll get the same result as in your second image.

@marlonrichert
Copy link
Owner

You can disable this behavior and keep the default fzf tab behavior by putting the following into your .zshrc file:

zstyle ':autocomplete:tab:*' completion fzf

@ztNFny
Copy link
Author

ztNFny commented Jun 9, 2020

is "zstyle ':autocomplete:" something that's defined by this plugin? I can only find information on "zstyle ':completion:" but not autocomplete

@marlonrichert
Copy link
Owner

zstyle is Zsh's mechanism for storing preferences. You can read more about it here: http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fzutil-Module

@ztNFny
Copy link
Author

ztNFny commented Jun 9, 2020

that one i found, i was wondering about :autocomplete: specifically

@ztNFny
Copy link
Author

ztNFny commented Jun 9, 2020

what I'm trying to achieve is when I'm in the middle of a word to use zsh-autocomplete (e.g. "ls tes") but with a space prefix to use fzf (e.g. "ls ") but I fail to see where in zsh-autocomplete.zsh that zstyle ':autocomplete:tab:*' completion fzf is handled to derive from it

@marlonrichert
Copy link
Owner

that one i found, i was wondering about :autocomplete: specifically

That's the prefix/namespace I use for zsh-autocomplete.

@marlonrichert
Copy link
Owner

marlonrichert commented Jun 9, 2020

what I'm trying to achieve is when I'm in the middle of a word to use zsh-autocomplete (e.g. "ls tes") but with a space prefix to use fzf (e.g. "ls ") but I fail to see where in zsh-autocomplete.zsh that zstyle ':autocomplete:tab:*' completion fzf is handled to derive from it

That's not currently doable out of the box. If that's a feature you want, please open a new issue for it. 🙂

@marlonrichert
Copy link
Owner

@ztNFny There's an issue for this now: #51. Let's discuss there.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants