远程服务器上安装on-my-zsh

安装zsh

第一步在远程终端上先安装git

  1. sudo yum install git -y

第二步先安装zsh 然后安装on-my-zsh
安转zsh

  1. yum install -y zsh
  2. chsh -l 展示终端列表
  3. chsh -s /bin/zsh 切换成zsh

第三步在安装on-my-zsh

  1. sh -c "$(wget -O- https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh)"

出现以下界面,显示安装成功
c7120a264a3f6a19ba739067d29be15.png

第四步查看并修改/.zshrc 文件

查看主题 vim ~/.zshrc 我选择 robbyrussell 编辑文本内容:ZSH_THEME=”robbyrussell”
image.png
修改完配置文件需要重新加载:source ~/.zshrc
备注:主题可以在此处预览:https://github.com/ohmyzsh/ohmyzsh/wiki/Themes

插件安装:

  1. zsh-syntax-highlighting:高亮(命令正确时会绿色显示,否则红色显示)此插件需要安装
    1. 慢就用国内的gitee
    2. git clone https://gitee.com/gloriaied/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  2. zsh-autosuggestion:自动提示
    1. 慢就用国内的gitee
    2. git clone https://gitee.com/hailin_cool/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

    END

    注意:插件都安转好以后 需要修改 .zshrc 文件
    image.png
    更换成(原来的文件中只有plugins=(git) 是没有任何插件的 所有要跟换
    1. plugins=(git
    2. zsh-autosuggestions
    3. zsh-syntax-highlighting
    4. )