1.安装zsh和git
yum install -y zsh && yum install -y git
#切换shell
[root@localhost hky]# chsh -s /bin/zsh
Changing shell for root.
Shell changed.
#重启 shell 才会生效
[root@localhost hky]# reboot
2.安装 oh-my-zsh
如果下载很慢可以到gitee上面去,上面有很多镜像,如果下载插件也慢,同样也可以去gitee
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
3.zsh-autosuggestions 自动提示
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
修改~/.zshrc配置文件,把插件添加到plugin中,如下图
nvim ~/.zshrc
刷新配置
source ~/.zshrc