zsh下docker命令tab补全方法
方法简介
1.下载补全脚本
mkdir -p ~/.zsh/completion
curl -L https://raw.githubusercontent.com/docker/docker/master/contrib/completion/zsh/_docker > ~/.zsh/completion/_docker
curl -L https://raw.githubusercontent.com/docker/compose/master/contrib/completion/zsh/_docker-compose > ~/.zsh/completion/_docker-compose
2.配置zshrc,编辑~/.zshrc
,添加以下两行
fpath=(~/.zsh/completion $fpath)
autoload -Uz compinit && compinit -u
3.重新打开shell