add bobby-with-date theme

pull/268/head
Alex Stupakov and alex choi 2014-02-12 16:55:31 -08:00 committed by Alex Stupakov and David Sabeti
parent 5cb0ecc1c8
commit b8c2359c5d
2 changed files with 27 additions and 0 deletions

View File

@ -30,6 +30,9 @@ RBENV_THEME_PROMPT_SUFFIX='|'
RBFU_THEME_PROMPT_PREFIX=' |'
RBFU_THEME_PROMPT_SUFFIX='|'
DATE_THEME_PROMPT_PREFIX='['
DATE_THEME_PROMPT_SUFFIX=']'
function scm {
if [[ -f .git/HEAD ]]; then SCM=$SCM_GIT
elif [[ -n "$(git symbolic-ref HEAD 2> /dev/null)" ]]; then SCM=$SCM_GIT
@ -143,6 +146,11 @@ function virtualenv_prompt {
fi
}
function date_prompt() {
DATE_STRING=$(date +"%Y-%m-%d %H:%M:%S %z")
echo -e "$DATE_THEME_PROMPT_PREFIX$DATE_STRING$DATE_THEME_PROMPT_SUFFIX"
}
# backwards-compatibility
function git_prompt_info {
git_prompt_vars

View File

@ -0,0 +1,19 @@
#!/usr/bin/env 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}|"
RVM_THEME_PROMPT_PREFIX="|"
RVM_THEME_PROMPT_SUFFIX="|"
function prompt_command() {
PS1="\n${blue}$(date_prompt)${yellow}$(ruby_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;