Created
September 27, 2013 17:11
-
-
Save jmolivas/6731842 to your computer and use it in GitHub Desktop.
partial .bash_profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Display git branch | |
function parse_git_branch { | |
[ -d .git ] || return 1 | |
git_status="$(git status 2> /dev/null)" | |
branch_pattern="^# On branch ([^${IFS}]*)" | |
remote_pattern="# Your branch is (.*) of" | |
diverge_pattern="# Your branch and (.*) have diverged" | |
if [[ ! ${git_status}} =~ "working directory clean" ]]; then | |
state="*" | |
fi | |
# add an else if or two here if you want to get more specific | |
if [[ ${git_status} =~ ${remote_pattern} ]]; then | |
if [[ ${BASH_REMATCH[1]} == "ahead" ]]; then | |
remote="↑" | |
else | |
remote="↓" | |
fi | |
fi | |
if [[ ${git_status} =~ ${diverge_pattern} ]]; then | |
remote="↕" | |
fi | |
if [[ ${git_status} =~ ${branch_pattern} ]]; then | |
branch=${BASH_REMATCH[1]} | |
echo " [${branch}${state}${remote}]" | |
fi | |
} | |
export PS1='\[\033[0;36m\]\w\[\033[0m\]$(parse_git_branch)$ ' | |
#Terminal colors | |
export CLICOLOR=1 | |
export LSCOLORS=Exfxcxdxbxegedabagacad | |
export GREP_OPTIONS='--color=auto' | |
# alias | |
alias php='/Applications/MAMP/bin/php/php5.4.4/bin/php' | |
alias mysqldump='/Applications/MAMP/Library/bin/mysqldump' | |
alias mysql='/Applications/MAMP/Library/bin/mysql' | |
alias ll='ls -l' | |
alias vup='vagrant up' | |
alias vh='vagrant halt' | |
alias vd='vagrant destroy' | |
alias vr='vagrant reload' | |
alias vssh='vagrant ssh' | |
alias dbfixture='app/console doctrine:database:drop --force && app/console doctrine:database:create && app/console doctrine:schema:create && app/console doctrine:fixtures:load' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment