Debian中zsh的安装与美化

注意

zshoh my zsh, 以及oh my zsh的插件都需要在各自用户下安装一遍。以防在root用户下安装后, 切换到普通用户发现不生效的情况。

普通用户下安装后需要注销重新登录才生效。

1
sudo apt install zsh
技巧
如果安装速度慢或者SSL错误, 可以先给此终端挂上代理, 参考终端代理设置
1
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
1
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
1
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

中国大陆用户可以使用Gitee上的官方镜像加速下载:

1
git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

编辑zsh配置文件:

1
ZSH_THEME="powerlevel10k/powerlevel10k"
1
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
1
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

编辑zsh配置文件:

1
2
3
4
5
plugins=(
  git
  zsh-autosuggestions
  zsh-syntax-highlighting
)