bash-completionをhomebrewでインストール
zshに憧れながらも、なかなかbashから離れられないので、bash-completionを入れてみた。
これ……便利!!もう、これないのbashなんて考えられない。
$ brew install bash-completion $ ln -s "/opt/local/Library/Contributions/brew_bash_completion.sh" "/opt/local/etc/bash_completion.d" $ vim ~/.bashrc $ cat ~/.bashrc ... # requre bash_completion if [ -f `brew --prefix`/etc/bash_completion ]; then source `brew --prefix`/etc/bash_completion fi
~/をHOMEパスに展開されたくないので、見よう見まねで.bashrcに下記も設定している。
_expand() { return 0; } __expand_tilde_by_ref() { return 0; }
このままだとsvnやgitを補完してくれないので、スクリプトを追加してやる。
$ wget "http://worksintheory.org/files/misc/bash_completion_svn" -O /usr/local/etc/bash_completion.d/svn $ wget 'http://git.kernel.org/?p=git/git.git;a=blob_plain;f=contrib/completion/git-completion.bash;hb=HEAD' -O /usr/local/etc/bash_completion.d/git $ . ~/.bashrc