Skip to content

Instantly share code, notes, and snippets.

@dmitryTsatsarin
Created June 19, 2015 08:24
Show Gist options
  • Save dmitryTsatsarin/9dd52e3be3d012758a77 to your computer and use it in GitHub Desktop.
Save dmitryTsatsarin/9dd52e3be3d012758a77 to your computer and use it in GitHub Desktop.
рабочий .bashrc
export HISTTIMEFORMAT="%d/%m/%y %T "
# python virtualenv
if [ -f /usr/local/bin/virtualenvwrapper.sh ]; then
export PROJECT_HOME=~/projects/
export WORKON_HOME=~/venvs/
export VIRTUAL_ENV_DISABLE_PROMPT=1
source /usr/local/bin/virtualenvwrapper.sh
fi
PS1_PWD_MAX=15
__pwd_ps1() { echo -n $PWD | sed -e "s|${HOME}|~|" -e "s|\(/[^/]*/\).*\(/.\{${PS1_PWD_MAX}\}\)|\1...\2|"; }
GIT_PS1_SHOWDIRTYSTATE=1
PS1='\[\033[01;34m\]$(__pwd_ps1)$(__git_ps1 " \[\033[01;31m\](%s)")$\[\033[00m\] '
#highlite virtual env enviroment
color_blue="\[$(/usr/bin/tput setaf 6)\]"
color_green="\[$(/usr/bin/tput setaf 2)\]"
function prompt_command {
local PS1_VENV=
local TSD_PS1_GIT='\[\033[01;34m\]$(__git_ps1 " \[\033[01;31m\](%s)")\[\033[00m\] '
if [[ ! -z $VIRTUAL_ENV ]]; then
#PS1_VENV="(venv: ${VIRTUAL_ENV#$WORKON_HOME}) "
PS1_VENV="(venv: ${color_blue}${VIRTUAL_ENV#$WORKON_HOME}${color_off}) "
fi
PS1=$PS1_VENV$TSD_PS1_GIT'\[\033[01;34m\]$(__pwd_ps1)$\[\033[00m\] '
}
PROMPT_COMMAND=prompt_command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment