总结Zsh作为Shell使用的常用配置,包括安装、配置主题、配置常用插件。

安装 Zsh

sudo apt install zsh

安装 Oh My Zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

配置p10k主题

  1. git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
  2. 启用主题,在~/.zshrc 中配置ZSH_THEME="powerlevel10k/powerlevel10k"
  3. 向导配置主题样式,重启终端或手动命令 p10k configure

配置插件

zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions

zsh-syntax-highlighting

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

调整插件配置

  • ~/.zshrc中将plugins=(git)修改为 plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

参考