LoginSignup
21

More than 5 years have passed since last update.

OSXにvagrant-bash-completionを導入する

Last updated at Posted at 2014-07-17

vagrantを頻繁にupしたりdestroyしたりbox addとかbox removeとかなんやかんやしていると毎度毎度コマンドをフルで実行するのが面倒になってくる。
ということで、導入した。

https://github.com/kura/vagrant-bash-completion
こちらのREADMEの通りに実行する。
※homebrewのインストールは割愛

$ brew tap homebrew/completions
Cloning into '/usr/local/Library/Taps/homebrew/homebrew-completions'...
remote: Reusing existing pack: 72, done.
remote: Total 72 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (72/72), done.
Checking connectivity... done.
Tapped 11 formulae

$ brew install vagrant-completion
==> Downloading https://raw.githubusercontent.com/mitchellh/vagrant/v1.6.2/contrib/bash/completion.sh
######################################################################## 100.0%
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
?  /usr/local/Cellar/vagrant-completion/1.6.2: 2 files, 12K, built in 2 seconds

インストール実行後は、.bashrcか.bash_profileに下記を記載する。

$ vim .bash_profile

if [ -f `brew --prefix`/etc/bash_completion.d/vagrant ]; then
    source `brew --prefix`/etc/bash_completion.d/vagrant
fi

$ source $HOME/.bash_profile

これでvagrant のあとのコマンドがタブ補完で出てくるのでだいぶ楽になった。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
21