zsh-syntax-highlighting
1.1、zsh-syntax-highlighting简介

zsh-syntax-highlighting是一个为zsh提供语法高亮的插件。

zsh-syntax-highlightingGitHub上的网址:https://github.com/zsh-users/zsh-syntax-highlighting

1.2、在macOS中安装zsh-syntax-highlighting

1、通过HomeBrew安装:

brew install zsh-syntax-highlighting

2、在~/.zshrc中添加如下配置:

source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

3、使配置生效:

source ~/.zshrc
1.3、Oh My Zsh用户安装zsh-syntax-highlighting

如果您是Oh My Zsh的用户,您可以按照下面的步骤进行安装:

1、通过git下载源代码:

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting

2、在~/.zshrc中添加如下配置:

plugins=( [plugins...] zsh-syntax-highlighting)

3、使配置生效:

source ~/.zshrc