zsh-autosuggestions工具帮助大家只输入一两个字母就能够显示一些历史的命令,很方便,强推!
bash
# 创建存放zsh插件的目录(比如~/.zsh/plugins)
mkdir -p ~/.zsh/plugins
# 克隆zsh-autosuggestions到该目录
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/plugins/zsh-autosuggestions
编辑~/.zshrc,在文件末尾添加以下内容(直接新增即可)
bash
# 加载zsh-autosuggestions插件
source ~/.zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
然后重新加载配置
bash
source ~/.zshrc
显示效果:
