一、安装

  1. 安装切换 shell 的工具、zsh
1
sudo dnf install -y util-linux-user zsh
  1. 切换 zsh
1
chsh -s $(which zsh)

二、oh-my-zsh

官网

  1. 安装

    • curl
1
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  • wget
1
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
  1. 安装主题
1
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
  1. 安装插件
  • zsh-autosuggestions自动补全插件
1
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  • zsh-syntax-highlighting语法高亮插件
1
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  1. 启用主题和插件
1
2
3
4
5
6
7
8
9
# 启用主题
ZSH_THEME="powerlevel10k/powerlevel10k"

# 启用插件
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
)
  1. 配置自定义的设置
1
p10k configure

会一次问一堆问题:

  • 能否看到某个图形
  • 选择某种样式