CentOS7 安装 zsh + Oh my zsh + tmux

  • 安装 zsh 并更改默认终端

    • yum -y install zsh git
    • chsh -s /bin/zsh
    • 重新远程连接
  • 配置 oh-my-zsh

    • 从 git 仓库中拉取 oh-my-zsh
      git clone https://gitee.com/mirrors/oh-my-zsh.git ~/.oh-my-zsh
    • 默认配置
      cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
  • 安装高亮、自动补全插件

    • 安装高亮插件:zsh-syntax-highlighting
      git clone https://gitee.com/dawnwords/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

    • 安装自动补全:zsh-autosuggestions
      git clone https://gitee.com/lhaisu/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

    • 安装 autojump 目录跳转

      • git clone https://gitee.com/gentlecp/autojump.git
      • cd autojump
      • ./install.py
  • 插件配置

    同样是打开.zshrc 文件,找到 plugins=(git),在这里增加自己想要的插件即可,多个插件名称之间使用空格或者换行分开(不能使用逗号)

    • vim ~/.zshrc

    • 增加自己想要的插件:

      plugins=(
              git
              sudo
              zsh-autosuggestions
              zsh-syntax-highlighting
              autojump
      )
      
    • 修改 zsh 主题: ZSH_THEME="maran"

    • source ~/.zshrc

文章参考: CSDN - 终极 Shell:Zsh(CentOS7 安装 zsh + Oh my zsh + tmux)