Skip to content

Instantly share code, notes, and snippets.

@lschwetlick
Last active August 2, 2019 15:00
Show Gist options
  • Select an option

  • Save lschwetlick/2400cb9ccda2ae5c530459c3a935668c to your computer and use it in GitHub Desktop.

Select an option

Save lschwetlick/2400cb9ccda2ae5c530459c3a935668c to your computer and use it in GitHub Desktop.
Custom Bash Prompt
NOCOLOR="\[\033[0;0m\]"
BLUE="\[\033[1;35m\]"
RED="\[\033[1;31m\]"
YELLOW="\[\033[1;33m\]"
# Setting PATH for Python 3.6
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
export PATH
if [ -f $(brew --prefix)/etc/bash_completion.d/git-prompt.sh ]; then
. $(brew --prefix)/etc/bash_completion.d/git-prompt.sh # This path might need to be adjusted
fi
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWSTASHSTATE=1
export GIT_PS1_SHOWUNTRACKEDFILES=1
# export GIT_PS1_SHOWUPSTREAM=verbose
# export GIT_PS1_DESCRIBE_STYLE=branch
function print_venv {
# returns the virtual env string
if [ -n "$VIRTUAL_ENV" ]; then
VE=$(basename "$VIRTUAL_ENV")
VE="(${BLUE}$VE${NOCOLOR})"
else
VE=""
fi
echo "$VE"
}
#export PROMPT_COMMAND='"hello " __git_ps1 "\u:" " \\\$ "'
export PROMPT_COMMAND='__git_ps1 "$(print_venv) \u:" " \\\$ "'
export GIT_PS1_SHOWCOLORHINTS=1
# git autocompletion
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment