快速安裝oh-my-zsh的插件zsh-syntax-highlighting 語法高亮

快速安裝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.效果展示

命令錯誤會顯示紅色,直到你輸入正確纔會變綠色
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章