mac在iTerm2中安装zsh

96 阅读1分钟
1.安装iTerm2

 iterm2.com/ 

2.安装zsh(使用brew)
brew install zsh
3.安装on-my-zsh(使用brew)

根据网上有很多种安装方式 可以参考这个issue(是针对超时的问题),但是都失败了。 github.com/ohmyzsh/ohm…

image.png

只有一种是成功了:使用wget安装,不确定是偶然还是什么原因。

使用官网推荐的wget安装

1.首先安装wget
brew install wget

2.执行下面命令
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

看到正常颜色有变化就可以了,剩下的安装插件设置样式就问题不大了,在配置.zshrc的时候,还是按照他的提示来填写(这里我的插件都是通过homebrew安装的,路径和网上看的不太一样):

autojump插件
[ -f /opt/homebrew/etc/profile.d/autojump.sh ] && . /opt/homebrew/etc/profile.d/autojump.sh

声明高亮插件zsh-syntax-highlighting
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

自动填充建议插件zsh-autosuggestions
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh

简单记录一下~

参考文章:

github官方:github.com/ohmyzsh/ohm…

zhuanlan.zhihu.com/p/589706383

zhuanlan.zhihu.com/p/550022490