主题选择:system
oh-my-zsh 插件推荐 : autojump、zsh-autosuggestion 以及 zsh-syntax-highlighting
cyan
评论:0
oh-my-zsh 插件推荐 : autojump、zsh-autosuggestion 以及 zsh-syntax-highlighting
- 本篇文章介绍了 oh-my-zsh 下三个插件 autojump、zsh-autosuggestion 和 zsh-syntax-highlighting 以及它们的安装教程
先在配置文件.zshrc 的 plugins 中添加添加插件(可灵活更改),三个插件安装完后再用
source ~/.zshrc
更新配置文件使更改生效
autojump
效果
实现目录间快速跳转,想去哪个目录直接 j + 目录名,不用在频繁的 cd 了!
安装
Mac 系统
$ brew install autojump
如果你是 linux 系统
$ git clone git://github.com/joelthelion/autojump.git
cd /autojump,执行
$ ./install.py
vim ~/.zshrc,把以下代码加到尾部
# 使用brew安装的
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh
source $ZSH/oh-my-zsh.sh
# 使用git安装的
[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && . ~/.autojump/etc/profile.d/autojump.sh
zsh-autosuggestion
效果
如图所示,输入命令时可提示自动补全(灰色部分),然后按键盘 → 即可补全(详细介绍)
安装
$ git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
zsh-syntax-highlighting
效果
日常用的命令会高亮显示,命令错误显示红色,如下图(详细介绍)
安装
$ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
最后用 source ~/.zshrc
命令更新配置文件,重启终端即可使用,来面对你船新的 zsh 吧!
评论