ZSH完成fzf-tab do do dotnet命令不使用
我启用了ZSH完成,并通过Zinit添加了FZF-TAB。它可以按预期工作。我添加了一些自定义/额外的完成,例如AWS CLI,它也按预期工作。
但是,当我试图按照建议的dotnet启用完成时,它不适用于FZF。请参阅下面的屏幕截图以及我的.zshrc的代码完成。
我缺少什么时候让Dotnet CLI使用FZF-TAB完成菜单工作?
[![autoload bashcompinit; bashcompinit
autoload -Uz compinit; compinit
_comp_options+=(globdots) # With hidden files
_dotnet_zsh_complete()
{
local completions=("$(dotnet complete "$words")")
reply=( "${(ps:\n:)completions}" )
}
compctl -K _dotnet_zsh_complete dotnet
complete -C "/usr/local/bin/aws_completer" aws][1]][1]
I enabled zsh completion and added fzf-tab via zinit. It works as expected. I added some custom/extra completions e.g., aws cli and it also worked as expected.
However, when I tried to enable the completion for dotnet as recommended it didn't work with fzf. Please see the screenshots below and the code from my .zshrc for the completions.
What am I missing to get dotnet cli work with fzf-tab completion menu?
[![autoload bashcompinit; bashcompinit
autoload -Uz compinit; compinit
_comp_options+=(globdots) # With hidden files
_dotnet_zsh_complete()
{
local completions=("$(dotnet complete "$words")")
reply=( "${(ps:\n:)completions}" )
}
compctl -K _dotnet_zsh_complete dotnet
complete -C "/usr/local/bin/aws_completer" aws][1]][1]
This is how it looks with system commands e.g., cp when I press TAB
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在尝试使用旧的compctl方式,该方式与FZF-TAB无法使用。
用以下内容替换.zshrc中的配置:
https://learn.microsoft.com/en-us/dotnet/core/core/tools/enable-tab-autocomplete
You are trying to use the old compctl way, which does not work with fzf-tab.
Replace your config in .zshrc with this:
source: https://learn.microsoft.com/en-us/dotnet/core/tools/enable-tab-autocomplete