M1 装上了 Arm 版 brew,一切都很好,唯一有个问题是之前可以按 tab 补全命令的,现在不行了,qit adb 都是正常的,不知道谁有遇到的吗?要如何解决?
解决了 To make Homebrew’s completions available in zsh, you must get the Homebrew-managed zsh site-functions on your FPATH before initialising zsh’s completion facility. Add the following to your ~/.zshrc file:
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH
autoload -Uz compinit
compinit
fi
This must be done before compinit is called. Note that if you are using Oh My Zsh, it will call compinit for you, so this must be done before you call oh-my-zsh.sh.
1
wengych 2020-12-26 11:57:32 +08:00
??
brew install zsh-completion ?? |
2
jfdnet 2020-12-26 12:08:43 +08:00
补全功能并不是 brew 带来的
|
6
sinxccc 2020-12-26 14:24:19 +08:00
在你的 .zshrc 里加上
setopt completealiases |
7
snooprat OP 最后还是在官方文档找到了解决方案,印象里之前没有配置过就能用,现在需要配置一下才生效。
To make Homebrew’s completions available in zsh, you must get the Homebrew-managed zsh site-functions on your FPATH before initialising zsh’s completion facility. Add the following to your ~/.zshrc file: if type brew &>/dev/null; then FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH autoload -Uz compinit compinit fi This must be done before compinit is called. Note that if you are using Oh My Zsh, it will call compinit for you, so this must be done before you call oh-my-zsh.sh. |