我正在使用 ZSH,oh-my-zsh,等等。如果我位于包含 justfile 的目录的根目录中,请键入
just
,然后按 Tab 键,它不会自动完成。
但是如果我在终端中
exec zsh
然后执行 just <tab>
,它就可以正常工作。我怎样才能解决这个问题?我怎样才能让它自动完成而不需要exec zsh
?
我在
just
项目自述文件中找到了解决方案。我之前已经搜索过很多次了,但没有找到解决方案。自述文件最近一定已更新。
将以下内容添加到您的
.zshrc
:
# Needed for just autocomplete, but will pull in all of brew
# https://github.com/casey/just#shell-completion-scripts
# Init Homebrew, which adds environment variables
eval "$(brew shellenv)"
# Add Homebrew's site-functions to fpath
fpath=($HOMEBREW_PREFIX/share/zsh/site-functions $fpath)
# Needed for autosuggestions (does compinit)
source $ZSH/oh-my-zsh.sh