ZSH 安装插件就是找不到路径,无法生效

251 天前
 owlzhang95

使用 Brew 安装了 zsh-autosuggestions 、zsh-syntax-highlighting 两个插件,执行完 source 提示

[oh-my-zsh] plugin 'zsh-autosuggestions' not found

[oh-my-zsh] plugin 'zsh-syntax-highlighting' not found

查询 ZSH WIKI 得知插件要安装到 zsh/custom/plugins 路径下,于是将 brew 路径下的插件挪到了该路径下,在 zshrc 文件中添加了

source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

source ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh

plugins=(brew git zsh-autosuggestions zsh-syntax-highlighting)

再次 source ,除了 not found ,还提示

no such file or directory: /Users/xx/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

no such file or directory: /Users/xx/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh

路径下有,还找不到就很奇怪,大佬们救救

693 次点击
所在节点    编程
2 条回复
AsuorZ
245 天前
用 zap
ABUbaff
222 天前
@AsuorZ 有个笨办法,直接在 GitHub 下载这两个包,注意文件夹改名,把文件夹放在 custom/plugin 中,在./zshrc 中只需要添加 plugin=(两个包名)就可以了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/973497

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX