oh-my-zsh 安装
oh-my-zsh 安装
1.安装 zsh
linux
下:
yum install zsh
mac
下:
brew install zsh
2.安装 oh-my-zsh
# 这里需要下载的是https://github.com/ohmyzsh/ohmyzsh ,但是github因为某些原因下不来,所以后面都使用gitee
wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh
# 然后给install.sh添加权限:
chmod +x install.sh
编辑 install.sh
vim install.sh
找到以下部分修改:
# Default settings
REPO=${REPO:-ohmyzsh/ohmyzsh}
REMOTE=${REMOTE:-https://github.com/${REPO}.git}
BRANCH=${BRANCH:-master}
# 修改其中的github为gitee,还有-ohmyzsh/ohmyzsh修改为-mirrors/oh-my-zsh
REPO=${REPO:-mirrors/oh-my-zsh}
REMOTE=${REMOTE:-https://gitee.com/${REPO}.git}
然后执行 ./install.sh
3.配置 zsh
vim ~/.zshrc
修改主题:
ZSH_THEME="robbyrussell"
# 改为
ZSH_THEME="ys"
修改插件:
plugins=(git)
# 改为
plugins=(git zsh-syntax-highlighting zsh-autosuggestions)
4. 下载插件
git clone https://gitee.com/fast-mirrors/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://gitee.com/fast-mirrors/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
5.刷新
source ~/.bash_profile
source ~/.zshrc