安装zsh

# linux
yum install zsh

# mac
brew install zsh

安装ohmyzsh

# curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# wget
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# fetch
sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

安装美化插件

# 自动提示插件zsh-autosuggestions安装
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

# 语法高亮插件zsh-syntax-highlighting安装
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions

切换主题

编辑配置文件,找到 ZSH_THEME
vim ~/.zshrc

#ZSH_THEME="robbyrussell"
ZSH_THEME="agnoster"
#ZSH_THEME="random"
#ZSH_THEME="rkj"

启用插件

# 在plugin中添加zsh-autosuggestions和zsh-syntax-highlighting
vim ~/.zshrc
# 找到plugins添加插件
plugins=(
  git
  zsh-autosuggestions
  zsh-syntax-highlighting
)

# :wq  #保存退出

source ~/.zshrc

参考:【美化终端】安装配置zsh和oh-my-zsh https://www.jianshu.com/p/8ba7786a09b7