Skip to content

Instantly share code, notes, and snippets.

@yvesvanbroekhoven
Created September 12, 2011 08:46
Show Gist options
  • Save yvesvanbroekhoven/1210857 to your computer and use it in GitHub Desktop.
Save yvesvanbroekhoven/1210857 to your computer and use it in GitHub Desktop.
Bash-it Template Modern customized
SCM_THEME_PROMPT_PREFIX=""
SCM_THEME_PROMPT_SUFFIX=""
RVM_THEME_PROMPT_PREFIX="["
RVM_THEME_PROMPT_SUFFIX="]"
SCM_THEME_PROMPT_DIRTY=' ${bold_red}✗${normal}'
SCM_THEME_PROMPT_CLEAN=' ${bold_green}✓${normal}'
SCM_GIT_CHAR='${bold_green}${normal}'
SCM_SVN_CHAR='${bold_cyan}${normal}'
SCM_HG_CHAR='${bold_red}${normal}'
case $TERM in
xterm*)
TITLEBAR="\[\033]0;\w\007\]"
;;
*)
TITLEBAR=""
;;
esac
PS3=">> "
is_vim_shell() {
if [ ! -z "$VIMRUNTIME" ]
then
echo "[${cyan}vim shell${normal}]"
fi
}
modern_scm_prompt() {
CHAR=$(scm_char)
if [ $CHAR = $SCM_NONE_CHAR ]
then
return
else
echo "[${white}$(scm_prompt_info)]"
fi
}
prompt() {
if [ $? -ne 0 ]
then
# Yes, the indenting on these is weird, but it has to be like
# this otherwise it won't display properly.
PS1="${TITLEBAR}${bold_red}┌─${reset_color}$(rvm_version_prompt)$(modern_scm_prompt)[${cyan}\W${normal}]$(is_vim_shell)
${bold_red}└─▪${normal} "
else
PS1="${TITLEBAR}┌─${cyan}$(rvm_version_prompt)${reset_color}$(modern_scm_prompt) ${light_green}\w${normal}$(is_vim_shell)
└─▪ "
fi
}
PS2="└─▪ "
PROMPT_COMMAND=prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment