sudo apt-get install zsh
wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh
chmod +x install.sh
然后执行
./install.sh
如果发现很慢,可以修改为
gitee:
vim install.sh
进入编辑状态:
找到以下部分:
#Default settings
ZSH=${ZSH:-~/.oh-my-zsh}
REPO=${REPO:-ohmyzsh/ohmyzsh}
REMOTE=${REMOTE:-https://github.com/${REPO}.git}
BRANCH=${BRANCH:-master}
然后将中间两行改为:
REPO=${REPO:-mirrors/oh-my-zsh}
REMOTE=${REMOTE:-https://gitee.com/${REPO}.git}
然后保存退出::wq
重新执行即可。
vim ~/.zshrc
修改主题和插件
ZSH_THEME="ys"
plugins=(git zsh-syntax-highlighting zsh-autosuggestions extract z pip sudo co mmand-not-found conda-zsh-completion )
如果之前bashrc里已经配置了文件比如conda和cuda,请把~/.bashrc
的内容复制到~/.zshrc
。
source ~/.zshrc
发现同上报错是正常的,因为我们还没有下载插件,直接就配置了。
安装插件
git clone https://gitee.com/mirror-hub/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://gitee.com/chenweizhen/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
source .zshrc
其他的插件都是自带的,不用下载。
参考了其他人的博客,实践是可用的