zhs_oh_my_zhs命令行高亮插件安装2021
作者:互联网
文章目录
reference link1:How Do I Enable Syntax Highlighting in ZSH
reference link2
高亮插件不依赖于oh My zsh
下载(克隆)插件
可以根据(reference link1)执行,这里需要注意的是,插件的克隆位置
您可以尝试如下做法来避免出错:
检查目录是否存在:
cd ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
如果没有报错,那么可以直接执行安装步骤,否则,您需要手动创建相应的目录.
mkdir -p ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
或者尝试一下命令来创建
mkdir -p ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
正式开始下载
下载(clone)插件到指定目录
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
在zshrc中注册该插件
Finally, add the zsh-syntax-highlighting as the plugin in your .zshrc file as:
plugins=( zsh-syntax-highlighting)
但是一般的,您的插件不只一个,可以写成如下形式
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
zsh-autosuggestions
#其他插件...
autojump
zsh-syntax-highlighting
)
激活该配置,使插件生效
To apply the changes to your current terminal session, enter the command:
source ~/.oh-my-zsh/zshrc
标签:zhs,highlighting,oh,插件,syntax,plugins,zsh 来源: https://blog.csdn.net/xuchaoxin1375/article/details/121055017