From 1d6664ec420ff19dae837def525f1b7af1cef8f6 Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Fri, 10 Apr 2015 18:07:39 +0200 Subject: brew.sh: Use bash-completion2 for improved Bash 4 completion Hat tip: @elyscape in https://github.com/mathiasbynens/dotfiles/commit/91be10dcee350465566a48cbe303686d2d989d6d#commitcomment-10654929. --- .bash_profile | 4 ++-- brew.sh | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.bash_profile b/.bash_profile index daa7552..4db6384 100644 --- a/.bash_profile +++ b/.bash_profile @@ -26,8 +26,8 @@ for option in autocd globstar; do done; # Add tab completion for many Bash commands -if which brew > /dev/null && [ -f "$(brew --prefix)/etc/bash_completion" ]; then - source "$(brew --prefix)/etc/bash_completion"; +if which brew > /dev/null && [ -f "$(brew --prefix)/share/bash-completion/bash_completion" ]; then + source "$(brew --prefix)/share/bash-completion/bash_completion"; elif [ -f /etc/bash_completion ]; then source /etc/bash_completion; fi; diff --git a/brew.sh b/brew.sh index 6e0aed5..bf5e871 100755 --- a/brew.sh +++ b/brew.sh @@ -29,7 +29,8 @@ brew install gnu-sed --with-default-names # Note: don’t forget to add `/usr/local/bin/bash` to `/etc/shells` before # running `chsh`. brew install bash -brew install bash-completion +brew tap homebrew/versions +brew install bash-completion2 # Install `wget` with IRI support. brew install wget --with-iri -- cgit v1.2.3