安装git
yum -y install git
安装zsh
sudo apt install zsh #(ubuntu)
sudo yum install zsh #(centos)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
安装theme(可选),这里只是个示例,自带的主题其实就有很多了,可以不安装。
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
修改 ~/.zshrc文件
vi ~/.zshrc
修改:
# ZSH_THEME="robbyrussell"
ZSH_THEME="powerlevel10k/powerlevel10k"
安装自动补全插件
Clone this repository into $ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins)
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
配置自动补全插件
Add the plugin to the list of plugins for Oh My Zsh to load (inside ~/.zshrc)
vi ~/.zshrc
修改:
plugins=(docker git kubectl zsh-autosuggestions)
重新打开一个terminal窗口或者重新登入,即可测试。
另外:如果想查看zsh自带的主题有哪些,到以下目录中查看:
cd ~/.oh-my-zsh/themes