Skip to content

Commit

Permalink
Fix prompt change for pyenv-virtualenv
Browse files Browse the repository at this point in the history
- pyenv/pyenv-virtualenv#135 (comment)
- stopped matching searches in vim as they are typed
  • Loading branch information
jmeridth committed Jun 24, 2016
1 parent 40363a9 commit ae4370a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 21 deletions.
55 changes: 36 additions & 19 deletions bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,39 @@ GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWSTASHSTATE=true
GIT_PS1_SHOWCOLORHINTS=true

BLACK="\[\e[0;30m\]"
DGRAY="\[\e[1;30m\]"
BLUE="\[\e[0;34m\]"
LBLUE="\[\e[1;34m\]"
GREEN="\[\e[0;32m\]"
LGREEN="\[\e[1;32m\]"
CYAN="\[\e[0;36m\]"
LCYAN="\[\e[1;36m\]"
RED="\[\e[0;31m\]"
LRED="\[\e[1;31m\]"
PURPLE="\[\e[0;35m\]"
LPURPLE="\[\e[1;35m\]"
BROWN="\[\e[0;33m\]"
YELLOW="\[\e[1;33m\]"
LGRAY="\[\e[0;37m\]"
WHITE="\[\e[1;37m\]"
RESET_COLOR="\[\e[0m\]"

export PS1="$WHITE[\h]${CYAN}[\w]\n\$(__git_ps1 '[%s]')${YELLOW}->\$ ${RESET_COLOR}"
function updatePrompt {
BLACK="\[\e[0;30m\]"
DGRAY="\[\e[1;30m\]"
BLUE="\[\e[0;34m\]"
LBLUE="\[\e[1;34m\]"
GREEN="\[\e[0;32m\]"
LGREEN="\[\e[1;32m\]"
CYAN="\[\e[0;36m\]"
LCYAN="\[\e[1;36m\]"
RED="\[\e[0;31m\]"
LRED="\[\e[1;31m\]"
PURPLE="\[\e[0;35m\]"
LPURPLE="\[\e[1;35m\]"
BROWN="\[\e[0;33m\]"
YELLOW="\[\e[1;33m\]"
LGRAY="\[\e[0;37m\]"
WHITE="\[\e[1;37m\]"
RESET_COLOR="\[\e[0m\]"

PROMPT="$WHITE[\h]${CYAN}[\w]\n"

if [[ $VIRTUAL_ENV != "" ]]; then
PROMPT="$PROMPT${LCYAN}($(basename ${VIRTUAL_ENV}))${RESET_COLOR}"
fi

if type "__git_ps1" > /dev/null 2>&1; then
PROMPT="$PROMPT\$(__git_ps1 '[%s]')${YELLOW}->"
fi

PS1="$PROMPT\$ ${RESET_COLOR}"
}
export -f updatePrompt
export PROMPT_COMMAND='updatePrompt'

# HOMEBREW
if which brew > /dev/null; then export PATH=$(brew --prefix)/lib:$PATH; fi
Expand Down Expand Up @@ -59,6 +73,9 @@ export PROJECT_HOME=$HOME/dev
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi

# PYENV-VIRTUALENV
export PYENV_VIRTUALENV_VERBOSE_ACTIVE=1
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi

Expand Down
4 changes: 2 additions & 2 deletions vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ let g:pymode_folding = 0
"" Rainbow parens
let g:rainbow_active = 1
"" Jedi Vim
let g:jedi#use_splits_not_buffers = "right"
let g:jedi#use_splits_not_buffers = "bottom"
filetype indent plugin on
syntax on " syntax coloring on
set cursorline " hightlight current line
Expand All @@ -142,7 +142,7 @@ set ai
set si
"" ignore case on search
set ignorecase
set incsearch
"" set incsearch
"" highlight search results
set hlsearch
"" show matching brackets
Expand Down

0 comments on commit ae4370a

Please sign in to comment.