效果

效果

安装zsh(mac自带)

sudo yum install -y zsh

sudo apt-get install -y zsh

安装Oh My Zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

换主题

vi ~/.zshrc

修改 ZSH_THEME 为 ys (开头的效果,很简洁)

ZSH_THEME=ys

主题文件位置:~/.oh-my-zsh/themes

安装插件

进入插件路径

cd ~/.oh-my-zsh/plugins

下载自动补齐、高亮、建议插件

wget http://mimosa-pudica.net/src/incr-0.2.zsh
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
git clone https://github.com/zsh-users/zsh-autosuggestions
source incr*.zsh

修改配置文件

$ vi ~/.zshrc
plugins=(git
zsh-syntax-highlighting
zsh-autosuggestions)
source ~/.oh-my-zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh##

关闭自动更新检查

如果你的服务器需要接受外部自动ssh登录并执行一些工作,那么你最好关闭oh my zsh的版本更新检查,否则当有更新的时候ssh登录服务器时会停在「Would you like to check for updates' prompt」这个提示上并卡住。

关闭方法:修改.zshrc,在「source $ZSH/oh-my-zsh.sh」之前添加一行「DISABLE_AUTO_UPDATE="true"」

You have to add DISABLE_AUTO_UPDATE="true" on your .zshrc before the source $ZSH/oh-my-zsh.sh line. By doing so, oh-my-zsh will just skip the update checking script.
$ vi ~/.zshrc
...
DISABLE_AUTO_UPDATE="true"
source $ZSH/oh-my-zsh.sh

完工

Last modification:February 19, 2022
If you think my article is useful to you, please feel free to appreciate