好的工具是成功的一半。
安装zsh
# CentOS
yum install zsh
# mac 10.15及之后 系统默认zsh
brew install zsh
将zsh设置为默认shell
chsh -s /bin/zsh
安装oh-my-zsh
方式一
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
是的,最有可能的是你没有办法通过这种简单的方式完成安装。
方式二
前往地址,将install.sh中的内容全部拷贝,新建install.sh文件,再赋予运行权限,最后执行。
vim install.sh
chmod a+x install.sh
./install.sh
修改主题
ls ~/.oh-my-zsh/themes
我喜欢的是steeef
vim ~/.zshrc
ZSH_THEME="steeef"
安装插件
最常用的插件 zsh-autosuggestion和zsh-syntax-highlighting
zsh-autosuggestion
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
zsh-syntax-highlighting
git clone git://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
修改配置文件
vim ~/.zshrc
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)