##安装bash-completiongit
用homebrew安装bash-completion
软件包:brew install bash-completion
github
把下面内容添加到你的~/.bash_profile
:bash
if [ -f $(brew --prefix)/etc/bash_completion ]; then . $(brew --prefix)/etc/bash_completion fi
重启bash,看看是否是不少命令均可以经过tab自动补全了?curl
##添加其它自动补全支持url
有些命令的自动补全支持不在bash-completion
内,这时候能够手动添加进去,以git为例:code
cd /usr/local/opt/bash-completion/etc/bash_completion.d curl -L -O https://raw.github.com/git/git/master/contrib/completion/git-completion.bash brew unlink bash-completion brew link bash-completion
如今试试看,git 命令是否是已经能够自动补全了?homebrew
其它经常使用命令自动补全文件:get