zsh-autosuggestions
1.1、zsh-autosuggestions简介
是什么 ?:a auto suggestions plugin for zsh
开发语言:zsh
源码仓库:https://github.com/zsh-users/zsh-autosuggestions
1.2、在macOS中安装zsh-autosuggestions

step1、通过HomeBrew安装zsh-autosuggestions

brew install zsh-autosuggestions

step2、在~/.zshrc中添加如下配置

source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh

step3、使配置生效

source ~/.zshrc
1.3、Oh My Zsh用户安装zsh-autosuggestions

step1、通过git下载zsh-autosuggestions源代码

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

step2、在~/.zshrc中添加如下配置

plugins=( [plugins...] zsh-autosuggestions)

step3、使配置生效

source ~/.zshrc
1.4、配置zsh-autosuggestions

修改自动提示的文字颜色:

ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=6'

ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE变量的默认值是fg=8

1.5、如何接受给出的建议

如果给出的建议符合你的需要,那么按向右方向键即可。