2012-06-18 01:10:31 +02:00
|
|
|
########################################################################
|
|
|
|
# bash_profile, basically from the whole internet
|
|
|
|
# and a lot from @necolas, @mathiasbynens & @rtomayko
|
2013-01-27 11:24:46 +01:00
|
|
|
#
|
2012-06-18 01:10:31 +02:00
|
|
|
# https://github.com/mathiasbynens/dotfiles
|
|
|
|
# https://github.com/necolas/dotfiles
|
|
|
|
# https://github.com/rtomayko/dotfiles
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------
|
2012-06-25 18:51:11 +02:00
|
|
|
# Load ~/.private, ~/.bash_prompt
|
2012-06-18 01:10:31 +02:00
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
2015-03-28 02:42:45 +01:00
|
|
|
for file in ~/.{bash_paths,bash_prompt,exports,aliases,inputrc,private}; do
|
2015-07-21 01:23:09 +02:00
|
|
|
[ -r "$file" ] && [ -f "$file" ] && source "$file"
|
2014-09-01 10:59:24 +02:00
|
|
|
done;
|
|
|
|
unset file;
|
2012-06-18 01:10:31 +02:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
# SHELL OPTIONS
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
2012-07-15 05:26:24 +02:00
|
|
|
# Append to the Bash history file, rather than overwriting it
|
|
|
|
shopt -s histappend
|
|
|
|
|
2012-06-18 01:10:31 +02:00
|
|
|
# fuck that you have new mail shit
|
|
|
|
unset MAILCHECK
|
|
|
|
|
2014-05-23 16:11:05 +02:00
|
|
|
# Case-insensitive globbing (used in pathname expansion)
|
|
|
|
shopt -s nocaseglob
|
|
|
|
|
|
|
|
# Autocorrect typos in path names when using `cd`
|
|
|
|
shopt -s cdspell
|
|
|
|
|
2014-09-01 10:59:24 +02:00
|
|
|
# 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
|
2015-07-21 01:23:09 +02:00
|
|
|
shopt -s "$option" 2> /dev/null;
|
2014-09-01 10:59:24 +02:00
|
|
|
done;
|
|
|
|
|
2014-05-23 16:11:05 +02:00
|
|
|
# Add tab completion for many Bash commands
|
|
|
|
if which brew > /dev/null && [ -f "$(brew --prefix)/etc/bash_completion" ]; then
|
2015-07-21 01:23:09 +02:00
|
|
|
source "$(brew --prefix)/etc/bash_completion";
|
2014-06-16 11:01:01 +02:00
|
|
|
elif [ -f /etc/bash_completion ]; then
|
2015-07-21 01:23:09 +02:00
|
|
|
source /etc/bash_completion;
|
2014-06-16 11:01:01 +02:00
|
|
|
fi;
|
2014-05-23 16:11:05 +02:00
|
|
|
|
2014-11-03 17:40:13 +01:00
|
|
|
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
|
|
|
|
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2- | tr ' ' '\n')" scp sftp ssh;
|
2012-06-18 21:46:35 +02:00
|
|
|
|
2014-11-03 17:40:13 +01:00
|
|
|
# Add `killall` tab completion for common apps
|
|
|
|
complete -o "nospace" -W "Contacts Calendar Dock Finder Mail Safari iTunes SystemUIServer Terminal" killall;
|
2012-06-18 01:10:31 +02:00
|
|
|
|
2014-11-03 17:40:13 +01:00
|
|
|
# aws-cli tab completion
|
|
|
|
complete -C aws_completer aws
|
2015-01-13 16:27:03 +01:00
|
|
|
|
|
|
|
|
2016-05-02 00:43:41 +02:00
|
|
|
export NVM_DIR="$HOME/.nvm"
|
|
|
|
. "$(brew --prefix nvm)/nvm.sh"
|
|
|
|
|
2015-03-28 02:42:45 +01:00
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
# rvm
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
2015-01-13 16:27:03 +01:00
|
|
|
# Load RVM into a shell session *as a function*
|
2015-07-21 01:23:09 +02:00
|
|
|
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
|
2016-04-12 15:13:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
# gpg-agent
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
2016-05-02 00:43:41 +02:00
|
|
|
if [ -f "$HOME/.gnupg/.gpg-agent-info" ] && [ -n "$(pgrep gpg-agent)" ]; then
|
|
|
|
source "$HOME/.gnupg/.gpg-agent-info"
|
2016-04-12 15:13:43 +02:00
|
|
|
export GPG_AGENT_INFO
|
|
|
|
else
|
2016-05-02 00:43:41 +02:00
|
|
|
eval $(gpg-agent --daemon --write-env-file $HOME/.gnupg/.gpg-agent-info)
|
2016-04-12 15:13:43 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
# Google Cloud SDK
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
2016-05-02 00:43:41 +02:00
|
|
|
if [ -s "$HOME/Code/google-cloud-sdk/" ]; then
|
|
|
|
source "$HOME/Code/google-cloud-sdk/path.bash.inc"
|
|
|
|
source "$HOME/Code/google-cloud-sdk/completion.bash.inc"
|
2016-04-12 15:13:43 +02:00
|
|
|
fi
|