首先必须先安装 oh my zsh
zsh-autosuggestions GitHub仓库地址
https://github.com/zsh-users/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
## 备用(gitee)
git clone https://gitee.com/phpxxo/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
设置~/.zshrc,把zsh-autosuggestions添加到 Oh My Zsh 要加载的插件列表中
vim .zshrc
##搜索git 配置, /git 搜索 n 去查询第几个
#空格
plugins=(git zsh-autosuggestions)
source .zshrc
原文链接: https://www.jianshu.com/p/43c1b6e40c69