2017年11月18日 星期六

[mac] bash bash-completion 指令自動補齊


在ubuntu 中在 bash 打指令,
像是 git checkout 按上 tab 他會幫你自動補齊。

如果在mac bash 中呢?
使用 bash-completion

$ brew install bash-completion
==> Downloading https://homebrew.bintray.com/bottles/bash-completion-1.3_1.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring bash-completion-1.3_1.el_capitan.bottle.tar.gz
==> Caveats
Add the following lines to your ~/.bash_profile:
  if [ -f $(brew --prefix)/etc/bash_completion ]; then
    . $(brew --prefix)/etc/bash_completion
  fi

Homebrew's own bash completion script has been installed to
  /usr/local/etc/bash_completion.d

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/bash-completion/1.3_1: 188 files, 605.9K

沒有留言:

張貼留言