使用 zsh 和 justfile(自制软件)获得自动完成功能

问题描述 投票:0回答:1

我正在使用 ZSH,oh-my-zsh,等等。如果我位于包含 justfile 的目录的根目录中,请键入

just
,然后按 Tab 键,它不会自动完成。

但是如果我在终端中

exec zsh
然后执行
just <tab>
,它就可以正常工作。我怎样才能解决这个问题?我怎样才能让它自动完成而不需要
exec zsh

homebrew zsh oh-my-zsh just
1个回答
2
投票

我在

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
© www.soinside.com 2019 - 2024. All rights reserved.