Skip to content

Instantly share code, notes, and snippets.

@mhoffman
Last active November 8, 2017 17:34
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 mhoffman/5df55afc0fd730d5b0c41f582302fa6e to your computer and use it in GitHub Desktop.
Save mhoffman/5df55afc0fd730d5b0c41f582302fa6e to your computer and use it in GitHub Desktop.
# Show bash prompt with timer information
# and git branch
export GIT_PS1_SHOWDIRTYSTATE=true
export export GIT_PS1_SHOWSTASHSTATE=true
# set a fancy prompt
declare -F | grep __git_ps1 > /dev/null
if [ "$?" -eq 0 ]
then
echo ${platform}
export PS1='[dt: ${timer_show}s] \[\033[01;32m\]\u@\h\[\033[01;34m\]:\w\[\033[31m\]$(__git_ps1 "(%s)")\[\033[01;34m\]$\[\033[00m\] '
else
if [[ ${platform} == 'mac' ]]; then
export PS1='[dt: ${timer_show}s] \[\033[01;32m\]\u@\h\[\033[01;34m\]:\w\[\033[31m\]$(parse_git_branch)\[\033[01;34m\]$\[\033[00m\] '
else
export PS1='[dt: ${timer_show}s] \[\033[01;32m\]\u@\h\[\033[01;34m\]:\w\[\033[31m\]\[\033[01;34m\]$\[\033[00m\] '
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment