Skip to content

Instantly share code, notes, and snippets.

@ppeelen
Last active August 27, 2018 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ppeelen/d46f1daf74273469b2311c57ebbe23a5 to your computer and use it in GitHub Desktop.
Save ppeelen/d46f1daf74273469b2311c57ebbe23a5 to your computer and use it in GitHub Desktop.
My bash profile
# Update the path with other important bin folders
export PATH=$(echo $PATH | sed 's|/usr/local/bin||; s|/usr/local/sbin||; s|::|:|; s|^:||; s|\(.*\)|/usr/local/bin:/usr/local/sbin:\1|')
PATH="$PATH:~/bin:$HOME/.rvm/bin"
# Adding Bash Completion
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
# Show a different color on master & develop branch
## Checkout https://stackoverflow.com/a/12871094/406677 if __git_ps1 is missing
function git_branch_color() {
[[ $(__git_ps1 '%s') = 'master' || $(__git_ps1 '%s') = 'develop' ]] && echo '31' || echo '36';
}
## Git scripts
PS1="\[\033[1;37m\]\h:\[\033[33;1m\]\w\[\033[m\]\[\033[\$(git_branch_color)m\]\$(__git_ps1 '@%s')\[\033[m\]\$ "
export LS_COLORS=$LS_COLORS:'di=0;35:'
# Setting helpfull aliasses
alias cleanDerived="rm -rf ~/Library/Developer/Xcode/DerivedData/*"
alias updateWithDev="git checkout develop; git pull; git checkout -"
alias openWorkspace="open *.xcworkspace"
alias openProject="open *.xcodeproj"
alias gd="git diff"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment