cuongtransc
5/16/2014 - 6:40 PM

coc.zsh-theme

function collapse_pwd {
    echo $(pwd | sed -e "s,^$HOME,~,")
}

function prompt_char {
    if [ $UID -eq 0 ]; then
        echo "%{$fg_bold[red]%}#";
    else
        echo "$";
    fi
}

local ret_status="%(?:%{$fg_bold[green]%}➜:%{$fg_bold[red]%}➜)"

PROMPT='%{$fg_bold[cyan]%}%n@%m %{$reset_color%}%{$fg[white]%}[$(collapse_pwd)]%{$reset_color%} $(git_prompt_info)
\
${ret_status} $(prompt_char) %{$reset_color%}';

RPROMPT='%{$fg_bold[blue]%}%D{[%H:%M:%S]}%{$reset_color%}'

ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"