Go
Go

Linux上ZSH安装并配置on-my-zsh插件

记录Linux上ZSH相关的配置,从仓库安装配置并配置相关的插件,美化终端使之更容易操作。使用二次开发的on-my-zsh

  • 安装zsh,使用自带的包管理工具

    1
    2
    3
    apt install zsh # for Ubuntu
    yum install zsh # for CentOS,dnf replace yum also
    brew install zsh # MacOS
  • 安装on-my-zsh,克隆oh-my-zsh仓库或者使用安装脚本

    1
    wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh
  • 配置zsh,修改主题以及添加插件zsh-syntax-highlightingzsh-autosuggestions

    1
    2
    3
    4
    vim ~/.zshrc # root 
    ZSH_THEME="robbyrussell" # change, like "ys"
    plugins=(git zsh-syntax-highlighting zsh-autosuggestions) # search plugins and add
    source ~/.bash_profile
    1. 安装插件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
    2. 安装插件zsh-autosuggestions

      1
      git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  • 刷新zsh配置,配置完成

    1
    source ~/.zshrc