1. 首先得安装了homebrew,如果没装,先去装一下吧;
2. 安装bash-complerion:
brew install bash-completion
安装完成后自动补齐脚本默认放在/usr/local/etc/bash_completion.d/
目录下
3. 更新~/.bash_profile
,添加以下代码:
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
以上代码可以使用brew info bash-completion
查看: