快速安裝oh-my-zsh的插件zsh-syntax-highlighting
zsh-syntax-highlighting 語法高亮插件
作用:命令錯誤會顯示紅色,直到你輸入正確纔會變綠色
1.安裝如下(國內極速gitee倉庫)
git clone https://gitee.com/null_454_5218/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
2.配置如下
#安裝成功後,編輯配置文件[將下方的命令粘進去]
vi ~/.zshrc
#source 在當前bash環境下讀取並執行FileName(zshrc)中的命令
source ~/.zshrc
需要修改的文件內容,如下
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
zsh-autosuggestions
autojump
zsh-syntax-highlighting
)
[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh
source $ZSH/oh-my-zsh.sh
3.效果展示
命令錯誤會顯示紅色,直到你輸入正確纔會變綠色