安装zsh
sudo apt-get install zsh
cat /etc/shells #查看系统支持的所有shell,安装成功会显示zsh
安装oh-my-zsh
wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh
chmod u+x install.sh
默认下载是在githhub上的,可以将其改到gitee下载
ZSH=${ZSH:-~/.oh-my-zsh}
REPO=${REPO:-ohmyzsh/ohmyzsh}
REMOTE=${REMOTE:-https://github.com/${REPO}.git}
#改为以下内容
REPO=${REPO:-mirrors/oh-my-zsh}
REMOTE=${REMOTE:-https://gitee.com/${REPO}.git}
配置zsh
vim ~/.zshrc
将ZSH_THEME="robbyrussell"改成ZSH_THEME="af-magic"
将plugins=(git)改成plugins=(git zsh-syntax-highlighting zsh-autosuggestions)
source ~/.zshrc #会报错找不到插件zsh-syntax-highlighting和zsh-autosuggestions
#安装插件,如果下载的路径失效的话,可以到gitee上搜索同名插件
git clone https://gitee.com/zjy_1671/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://gitee.com/async_github/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
#插件会下载到~/.oh-my-zsh/custom}/plugins下
vim ~/.zshrc
#plugins下面填写下面几行,自动补全功能才能生效,使用右箭头自动补全,但是颜色高亮的好像不需要source
ZSH_CUSTOM=$ZSH/custom/
source $ZSH_CUSTOM/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source ~/.zshrc #再source一遍,或者可以先下载插件,再source
其他配置
禁用自动更新
vim ~/.zshrc
DISABLE_AUTO_UPDATE="true"#如需手动更新,在命令行执行upgrade_oh_my_zsh
卸载oh-my-zsh
uninstall_oh_my_zsh zsh
这篇文章详细介绍了在系统中安装zsh,然后安装oh-my-zsh框架的过程。它还提到了如何从gitee镜像源下载,并配置zsh的主题和插件,包括zsh-syntax-highlighting和zsh-autosuggestions。此外,文章还涵盖了禁用自动更新和卸载oh-my-zsh的步骤。
292

被折叠的 条评论
为什么被折叠?



