-
-
Save thauber/4264360 to your computer and use it in GitHub Desktop.
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
# Add this to your .bashrc | |
source ~/.make_ps1 | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/' | |
} | |
parse_virtualenv() { | |
echo '['$(basename $VIRTUAL_ENV 2> /dev/null)']' | sed -e '/\[\]/d' | |
} | |
function mworkon() | |
{ | |
workon "$@" | |
source ~/.make_ps1 | |
} | |
alias workon="mworkon" | |
# Create file in your home directory ".make_ps1" and add this to the top | |
PS1_L1="\[\e[1;30m\]Exit with [$?] @ \@\n" | |
PS1_L2="\[\e[1;31m\]\$(parse_git_branch)\[\e[1;33m\]\$(parse_virtualenv)\[\e[0;32m\][\u]\[\e[0;34m\]\w$ \[\e[1;33m\]" | |
PS1=$PS1_L1$PS1_L2 | |
#example (minus the color) | |
Exit with [0] @ 02:35 PM | |
[master][gather][thauber]~/Projects/TCF$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment