一、安装zsh

①:查看当前shell使用版本

  1. [root@localhost ~]# echo $SHELL
  2. /bin/bash

②:安装zsh

  1. yum install -y zsh
  1. [root@localhost ~]# yum install -y zsh
  2. 已加载插件:fastestmirror, langpacks
  3. Loading mirror speeds from cached hostfile
  4. * base: mirrors.aliyun.com
  5. * extras: mirrors.aliyun.com
  6. * updates: mirrors.aliyun.com
  7. 正在解决依赖关系
  8. --> 正在检查事务
  9. ---> 软件包 zsh.x86_64.0.5.0.2-34.el7_8.2 将被 安装
  10. --> 解决依赖关系完成

返回结果如下,表示切换完成。配置完成后需要重启方能生效!

③:设置zsh为shell默认版本

请在root用户下切换shell

  1. chsh -s /bin/zsh
  1. [root@localhost ~]# chsh -s /bin/zsh
  2. Changing shell for root.
  3. Shell changed.
  4. [root@localhost ~]#

二、安装git

  • 自动和手动安装都需要安装git
    1. yum install -y git
    1. [root@localhost ~]# yum install -y zsh
    2. 已加载插件:fastestmirror, langpacks
    3. Loading mirror speeds from cached hostfile
    4. * base: mirrors.aliyun.com
    5. * extras: mirrors.aliyun.com
    6. * updates: mirrors.aliyun.com
    7. 正在解决依赖关系
    8. --> 正在检查事务
    9. ---> 软件包 zsh.x86_64.0.5.0.2-34.el7_8.2 将被 安装
    10. --> 解决依赖关系完成

三、安装oh-my-zsh

  • 使用以下命令,自动安装oh-my-zsh

    1. sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  • 出现以下界面,显示安装成功 ```shell Looking for an existing zsh config… Using the Oh My Zsh template file and adding it to ~/.zshrc.

Time to change your default shell to zsh: Do you want to change your default shell to zsh? [Y/n] y Changing the shell… Changing shell for root. chsh: Shell not changed. Shell successfully changed to ‘/bin/zsh’.

  1. __ __

/ /_ _ __ _/ /
/ \/ \ / ` \/ / / / /
/ / _/ \ / // / / / / / / / / / / // / / /( ) / / / __// // // // //_, / /__/// //
/
/ ….is now installed!

Before you scream Oh My Zsh! look over the .zshrc file to select plugins, themes, and options.

• Follow us on Twitter: https://twitter.com/ohmyzsh • Join our Discord community: https://discord.gg/ohmyzsh • Get stickers, t-shirts, coffee mugs and more: https://shop.planetargon.com/collections/oh-my-zsh

  1. ---
  2. <a name="t8lNq"></a>
  3. ## 四、修改主题
  4. - 找到`.zshrc`的配置文件
  5. ```bash
  6. [root@localhost ~]# ll /root/.zshrc
  7. -rw-r--r--. 1 root root 3.8K 11月 24 15:55 /root/.zshrc
  • 在配置文件中修改主题 ```bash 默认主题为: ZSH_THEME=”robbyrussell”

修改主题为: ZSH_THEME=”agnoster” ```

  • 完成后,重启生效默认shell

image.png

五、修改XShell配色主题

  • 修改xshell的配色方案为:Obsidian的方案类型:

image.pngimage.png