我用的是腾讯云服务器,安装的 Centos 7 系统,下面是安装的教程和遇到的问题解决办法:
一、安装步骤:
安装 zsh
安装 git
下载
oh-my-zsh的安装脚本
- 安装 wget(centos7 默认是没有的)
- 下载 zsh 安装脚本
- 我这里因为用 github 源无法下载,一直卡在 clone into “xxx”,所以改换了国内的镜像源
gitee 源 wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh
- 编辑 install.sh
找到以下部分
Default settings
ZSH\=
{BRANCH:-master}
把
REPO={REMOTE:-[https://github.com/{REPO}.git})
替换为
REPO={REMOTE:-[https://gitee.com/{REPO}.git})
- 编辑后保存, 运行安装即可. (运行前先给 install.sh 权限)
赋予可执行权限
chomd +x install.sh # 运行 sh install.sh
- 修改仓库地址
cd ~/.oh-my-zsh
git remote set-url origin https://gitee.com/mirrors/oh-my-zsh.git
git pull
二、切换为 zsh
- 输入
cat /etc/shells命令来查看本地安装的 shell
/bin/sh
/bin/bash /usr/bin/sh
/usr/bin/bash /bin/tcsh /bin/csh /bin/zsh
- 切换 sehll 至 zsh
- 查看当前使用的 shell
三、oh-my-zsh 插件设置
- 编辑主题和插件
- 修改主题:找到下面设置主题的部分,修改引号中的名称即可(比如我这里用的 ys 主题)
- 修改插件:找到插件的部分,直接修改,常用的插件可以自行参考网上其他文章

plugins=(git
sublime
z
web-search
wd
zsh-autosuggestions
extract
zsh-syntax-highlighting)

- 刷新配置文件
- 在刷新配置的过程中,提示 zsh-autosuggestions、zsh-syntax-highlighting 插件 not found,可通过单独下载解决(下载后再次刷新配置文件):
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
https://www.cnblogs.com/silentims/p/13740267.html
