安装 on-my-zsh 插件

插件在 .zshrc 的 plugins 中进行添加。

这些插件可以让oh-my-zsh更好用,推荐安装,不安装对使用vim也没什么影响。
分两步

$ZSH_CUSTOM 安装完 zsh 后,默认已经存在。

安装 zsh-autosuggestions

这是一个超级好用的插件,直接显示命令的操作记录,可以快速使用重复命令。

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

这个插件会在终端以颜色的方式提示命令是否正确。

正确命令

正确命令

不正确的命令

不正确的命令

添加配置

zsh-autosuggestionzsh-syntax-highlighting

vim ~/.zshrc 在 plugins 中换行添加即可

plugins

复制代码

1
2
3
4
5
6
plugins=(
git
zsh-autosuggestions
autojump
zsh-syntax-highlighting
)