我正在使用zsh和oh my zsh,在关于放置补全文件的位置上有一些困惑。
例如,当安装"kind"时,我正在执行以下命令:
brew install kind
kind complete zsh > ~/.oh-my-zsh/cache/completions/_kind
我希望kind
的自动补全功能开始运作。我是把它们放在错误的目录下吗?
如果在当前终端中执行autoload -U compinit && compinit
,则完成工作,直到我重新启动终端。
我想我的.zshrc
非常标准,基本上就是这样:
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
export ZSH="$HOME/.oh-my-zsh"
DISABLE_MAGIC_FUNCTIONS="true"
plugins=(
git
gh
docker
docker-compose
kubectl
helm
dotnet
node
npm
github
zsh-syntax-highlighting
zsh-autosuggestions
history-substring-search
terraform)
autoload -U compinit && compinit
source $ZSH/oh-my-zsh.sh
autoload -U compinit && compinit
必须在我加载 oh my zsh 之后发生吗?如果是的话,为什么?