一、将 zsh 设置为系统默认 shell
# 普通用户
chsh -s /bin/zsh
# 重启系统
二、安装 oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
三、安装 powerlevel10k 主题
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
使用 vim 编辑 .zshrc,键入以下内容并保存:
ZSH_THEME="powerlevel10k/powerlevel10k"
四、安装相应插件
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
在 .zshrc 中,把 z 加入插件列表:
plugins=(
# other plugins...
zsh-autosuggestions
zsh-syntax-highlighting
z
)
开启新的 Shell 或执行 source ~/.zshrc,就可以开始体验插件了。