Merge pull request #88 from victorcoder/master

New theme envy and rbenv integration/plugin
pull/36/merge
Robert Evans 2011-12-19 10:34:33 -08:00
commit 12167fb1df
3 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,8 @@
#!/bin/bash
# Load rbebv, if you are using it
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
# Load the auto-completion script if rbenv was loaded.
source ~/.rbenv/completions/rbenv.bash

View File

@ -24,6 +24,9 @@ RVM_THEME_PROMPT_SUFFIX='|'
VIRTUALENV_THEME_PROMPT_PREFIX=' |'
VIRTUALENV_THEME_PROMPT_SUFFIX='|'
RBENV_THEME_PROMPT_PREFIX=' |'
RBENV_THEME_PROMPT_SUFFIX='|'
function scm {
if [[ -d .git ]]; then SCM=$SCM_GIT
elif [[ -n "$(git symbolic-ref HEAD 2> /dev/null)" ]]; then SCM=$SCM_GIT
@ -113,6 +116,13 @@ function rvm_version_prompt {
fi
}
function rbenv_version_prompt {
if which rbenv &> /dev/null; then
rbenv=$(rbenv global) || return
echo -e "$RBENV_THEME_PROMPT_PREFIX$rbenv$RBENV_THEME_PROMPT_SUFFIX"
fi
}
function virtualenv_prompt {
if which virtualenv &> /dev/null; then
virtualenv=$([ ! -z "$VIRTUAL_ENV" ] && echo "`basename $VIRTUAL_ENV`") || return

View File

@ -0,0 +1,16 @@
#!/bin/bash
SCM_THEME_PROMPT_DIRTY=" ${red}"
SCM_THEME_PROMPT_CLEAN=" ${bold_green}"
SCM_THEME_PROMPT_PREFIX=" |"
SCM_THEME_PROMPT_SUFFIX="${green}|"
GIT_THEME_PROMPT_DIRTY=" ${red}"
GIT_THEME_PROMPT_CLEAN=" ${bold_green}"
GIT_THEME_PROMPT_PREFIX=" ${green}|"
GIT_THEME_PROMPT_SUFFIX="${green}|"
function prompt_command() {
PS1="\n${yellow}$(rbenv_version_prompt)$(rvm_version_prompt) ${purple}\h ${reset_color}in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}${reset_color} "
}
PROMPT_COMMAND=prompt_command;