当前位置:   article > 正文

oh-my-zsh安装语法高亮插件zsh-syntax-highlighting(国内镜像)_oh my zsh 只安装代码高亮插件

oh my zsh 只安装代码高亮插件
  1. 插件下载地址 (gitee)
git clone https://gitee.com/Annihilater/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
  • 1
  1. 编辑 oh-my-zsh 的配置文件
vi ~/.zshrc
  • 1

.zshrc 需要修改两处地方:

  • 2.1 在plugins 添加上 zsh-syntax-highlighting
plugins=(
        git
        zsh-syntax-highlighting
)
  • 1
  • 2
  • 3
  • 4

注意:如果有其他插件,zsh-syntax-highlighting 要放到最尾

  • 2.2 在文档末尾添加
source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  • 1
  1. 保存后,执行
source ~/.zshrc
  • 1
  1. 验证:错误的命令会显示红色,正确的显示绿色

在这里插入图片描述
搞定。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/759434
推荐阅读
  

闽ICP备14008679号