1. 安装 zsh 并切换为默认 shell

centos:

yum install zsh -y 

debian/ubuntu:

apt install zsh -y

macos:

brew install zsh -y

然后:

chsh -s /bin/zsh

2. 安装 oh-my-zsh 并添加常用插件

视情况需要修改本地的 hosts 文件或者科学上网

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

若访问失败, host可参考我的另一篇文章:

https://www.jianshu.com/p/c181ea5469f3

3. 修改 zsh 配置, 启用插件

 vim ~/.zshrc
plugins=(
  git
  zsh-autosuggestions
  zsh-syntax-highlighting
)

最后 source 一下或者退出重进就行了