1:安裝oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
2、安裝zsh-autosuggestions
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
3、編輯~/.zshrc文件
找到plugins=(git)這一行,然后再添加autosuggestions,最后為:
plugins=(git zsh-autosuggestions)
4、重新打開命令行,當然你也可以source ./zshrc更新下你的zsh,這樣你就可以使用oh-my-zsh的同時享受到autosuggestions帶來的便利了.
總結:
1、你如果分開設置oh-my-zsh和autosuggestions,那么你的terminal的autosuggestions不會起作用的,所以你要把autosuggestions作為zsh的插件放到~/.zsh/plugins/下面,然后再在~/.zshrc文件中加入這個插件plugins=(git zsh-autosuggestions)
參考資料:
1、https://segmentfault.com/a/1190000002658335?_ea=438459
