Created
August 31, 2015 13:10
-
-
Save vandorjw/4d85f45cd22d5a2d9650 to your computer and use it in GitHub Desktop.
OS X Niceties - bashrc and other things
This file contains hidden or 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
| ## | |
| # .bashrc | |
| ## | |
| export PGDATA='/usr/local/var/postgres' | |
| export PGHOST=localhost | |
| alias start-pg='pg_ctl -l $PGDATA/server.log start' | |
| alias stop-pg='pg_ctl stop -m fast' | |
| alias show-pg-status='pg_ctl status' | |
| alias restart-pg='pg_ctl reload' | |
| # pip should only run if there is a virtualenv currently activated | |
| export PIP_REQUIRE_VIRTUALENV=true | |
| function color_my_prompt { | |
| local __user_and_host="\[\033[01;32m\]\u@\h" | |
| local __cur_location="\[\033[01;34m\]\w" | |
| local __git_branch_color="\[\033[31m\]" | |
| #local __git_branch="\`ruby -e \"print (%x{git branch 2> /dev/null}.grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1) ')\"\`" | |
| local __git_branch='`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`' | |
| local __prompt_tail="\[\033[35m\]$" | |
| local __last_color="\[\033[00m\]" | |
| export PS1="$__user_and_host $__cur_location $__git_branch_color$__git_branch$__prompt_tail$__last_color " | |
| } | |
| color_my_prompt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment