您当前的位置: 首页 > 

liaowenxiong

暂无认证

  • 2浏览

    0关注

    1171博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

用于zsh的高亮插件 zsh-syntax-highlighting

liaowenxiong 发布时间:2021-10-31 17:36:43 ,浏览量:2

文章目录
  • 简介
  • 安装
  • 配置

简介

zsh-syntax-highlighting 插件为 shell zsh 提供语法高亮显示。当命令在 zsh 提示符下输入到交互式终端时,它可以突出显示命令。这有助于在运行命令之前检查命令,特别是捕获语法错误。

主页地址:https://github.com/zsh-users/zsh-syntax-highlighting

安装

执行下面的命令安装 zsh-syntax-highlighting:

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

或者使用 HomeBrew 安装:

brew install zsh-syntax-highlighting
配置

接着打开 ~/.zshrc 文件进行编辑。找到 plugins,我们需要把高亮插件加上: 在这里插入图片描述 请务必保证插件顺序,zsh-syntax-highlighting 必须在最后一个。

然后在文件末尾添加:

source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # 如果使用命令 brew 安装,则是添加这条命令语句

接着保存退出,然后执行下面的命令立即生效:

source ~/.zshrc

我已经安装了,但是命令语法并没有高亮显示!

关注
打赏
1661566967
查看更多评论
立即登录/注册

微信扫码登录

0.0822s