常用 zsh 插件

基本操作

# macOS 
brew install git autojump zsh-syntax-highlighting zsh-autosuggestions zsh-completions

# Debian/Centos
apt install -y zsh / yum install -y zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

➜  ~ cd .oh-my-zsh/plugins
➜  plugins git:(master)
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
git clone https://github.com/zsh-users/zsh-autosuggestions

echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
echo "source ${(q-)PWD}/zsh-autosuggestions/zsh-autosuggestions.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc

cd 
source .zshrc

增强对 kubectl 支持

修改~/.zshrc文件,增加如下两行:

plugins=(kubectl)
source <(kubectl completion zsh)

保存后重启终端即可生效或者source .zshrc