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(语法高亮)两个插件

  1. 执行git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

  2. 执行git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

  3. 修改.zshrc文件

    找到plugins=(git)这一行,将zsh-autosuggestionszsh-syntax-highlighting插入其中,用空格隔开

  4. 执行source ~/.zshrc使配置文件生效

遇到的问题

  1. 命令行输入node/npm等命令后,提示command not found

    执行echo 'export PATH="/opt/homebrew/opt/node@17/bin:$PATH"' >> ~/.zshrc,然后执行source ~/.zshrc