Skip to content

Instantly share code, notes, and snippets.

@gabrielfalcao
Created December 14, 2017 05:04
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 gabrielfalcao/9f8158452ff8c7aa46e6cf09ef555881 to your computer and use it in GitHub Desktop.
Save gabrielfalcao/9f8158452ff8c7aa46e6cf09ef555881 to your computer and use it in GitHub Desktop.
bashrc PS1 with git and virtualenv
# ANSI COLORS FOR $PS1
declare -x black="\[\033[0;30m\]"
declare -x red="\[\033[1;31m\]"
declare -x green="\[\033[38;5;155m\]"
declare -x yellow="\[\033[38;5;220m\]"
declare -x blue="\[\033[1;34m\]"
declare -x purple="\[\033[38;5;197m\]"
declare -x cyan="\[\033[1;36m\]"
declare -x white="\[\033[1;37m\]"
declare -x bold="\[\033[1m\]"
declare -x reset="\[\033[0m\]"
export TERM="xterm-color"
# highlight color of `grep --color`
export GREP_COLOR='01;33'
function __venv_ps1_icon() {
[ -n "$VIRTUAL_ENV" ] && echo -ne "\033[38;5;155m" || echo -ne "\033[38;5;197m"
echo -en "ॐ"
echo -en "\033[0m"
}
export ORIG_PS1="$green\W$white\$(__git_ps1 \"$bold@$yellow%s$reset\") \[\$(__venv_ps1_icon)\] "
export PS1="$reset${ORIG_PS1}\033]\007"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment