Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request Bash-it#88 from victorcoder/master
New theme envy and rbenv integration/plugin
  • Loading branch information
revans committed Dec 19, 2011
2 parents ce6ec17 + e7deb90 commit 12167fb
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/available/rbenv.plugin.bash
@@ -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
10 changes: 10 additions & 0 deletions themes/base.theme.bash
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions themes/envy/envy.theme.bash
@@ -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;

0 comments on commit 12167fb

Please sign in to comment.