diff --git a/bash_profile b/bash_profile index a6a1d40..1f8f570 100644 --- a/bash_profile +++ b/bash_profile @@ -12,10 +12,10 @@ # Load ~/.private, ~/.bash_prompt # ---------------------------------------------------------------------- -for file in ~/.{bash_prompt,aliases,private}; do +for file in ~/.{bash_prompt,aliases,private,inputrc}; do [ -r "$file" ] && [ -f "$file" ] && source "$file" -done -unset file +done; +unset file; # ---------------------------------------------------------------------- # SHELL OPTIONS @@ -37,6 +37,13 @@ shopt -s nocaseglob # Autocorrect typos in path names when using `cd` shopt -s cdspell +# Enable some Bash 4 features when possible: +# * `autocd`, e.g. `**/qux` will enter `./foo/bar/baz/qux` +# * Recursive globbing, e.g. `echo **/*.txt` +for option in autocd globstar; do + shopt -s "$option" 2> /dev/null; +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"; @@ -51,21 +58,21 @@ export ARCHFLAGS="-arch x86_64" # PATH # ---------------------------------------------------------------------- -PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin"; +# we want the various sbins on the path along with /usr/local/bin +PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin" +PATH="/usr/local/bin:$PATH" # if these bins exist, then add them to the PATH ANDROID_HOME="/usr/local/opt/android-sdk" -[ -d "$ANDROID_HOME" ] && PATH="$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools"; +[ -d "$ANDROID_HOME" ] && PATH="$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools" -# add to beginning of PATH so that it always take precedence over /usr/bin -[ -d "/usr/local/bin" ] && PATH="/usr/local/bin:$PATH"; -[ -d "/usr/local/mysql/bin" ] && PATH="/usr/local/mysql/bin:$PATH"; -[ -d "/usr/local/share/npm/bin" ] && PATH="/usr/local/share/npm/bin:$PATH"; +[ -d "/usr/local/mysql/bin" ] && PATH="/usr/local/mysql/bin:$PATH" +[ -d "/usr/local/share/npm/bin" ] && PATH="/usr/local/share/npm/bin:$PATH" -[ -d "$HOME/.rvm/bin" ] && PATH="$HOME/.rvm/bin:$PATH"; # Add RVM to PATH for scripting +[ -d "$HOME/.rvm/bin" ] && PATH="$HOME/.rvm/bin:$PATH" # Add RVM to PATH for scripting [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* -export PATH +export PATH; # ---------------------------------------------------------------------- # LSCOLORS diff --git a/inputrc b/inputrc new file mode 100644 index 0000000..5760a7b --- /dev/null +++ b/inputrc @@ -0,0 +1,5 @@ +# Use case-insensitive TAB autocompletion +set completion-ignore-case on + +# Auto list tab completions (use instead of TAB-cycling) +set show-all-if-ambiguous on \ No newline at end of file diff --git a/make.sh b/make.sh index 55f479c..0a5da86 100755 --- a/make.sh +++ b/make.sh @@ -14,7 +14,7 @@ # dotfiles directory dir=~/Projects/dotfiles # list of files/folders to symlink in homedir -files="aliases bashrc bash_profile bash_prompt gemrc gitconfig gitignore_global hushlogin private tm_properties generator.json npmrc" +files="aliases bashrc bash_profile bash_prompt gemrc gitconfig gitignore_global hushlogin inputrc private tm_properties generator.json npmrc" # ---------------------------------------------------------------------- # change to the dotfiles directory diff --git a/update.sh b/update.sh index 5081e0f..106a960 100755 --- a/update.sh +++ b/update.sh @@ -14,7 +14,7 @@ # dotfiles directory dir=~/Projects/dotfiles # list of files/folders to symlink in homedir -files="aliases bashrc bash_profile bash_prompt gemrc gitconfig gitignore_global hushlogin private tm_properties generator.json npmrc" +files="aliases bashrc bash_profile bash_prompt gemrc gitconfig gitignore_global hushlogin inputrc private tm_properties generator.json npmrc" # ---------------------------------------------------------------------- # change to the dotfiles directory