oh-my-zsh 的安装
oh-my-zsh
安装 sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
然后安装zsh-autosuggestions(命令建议)
、zsh-syntax-highlighting(语法高亮)
两个插件
执行
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
执行
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
修改
.zshrc
文件找到
plugins=(git)
这一行,将zsh-autosuggestions
、zsh-syntax-highlighting
插入其中,用空格隔开执行
source ~/.zshrc
使配置文件生效
遇到的问题
命令行输入
node/npm
等命令后,提示command not found
执行
echo 'export PATH="/opt/homebrew/opt/node@17/bin:$PATH"' >> ~/.zshrc
,然后执行source ~/.zshrc