Add zsh-theme with username path and clean/dirty git repo

This commit is contained in:
Thomas Cioppettini 2012-12-28 00:04:35 -05:00
commit db3f42df5c

16
themes/ciop.zsh-theme Normal file
View file

@ -0,0 +1,16 @@
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
function get_pwd() {
print -D $PWD
}
PROMPT=$'%{$fg[cyan]%}%m $fg[yellow]$(get_pwd) $(git_prompt_info)\
%{$fg[red]%}➜ %{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX="[git:"
ZSH_THEME_GIT_PROMPT_SUFFIX="]$reset_color"
ZSH_THEME_GIT_PROMPT_DIRTY="$fg[red]+"
ZSH_THEME_GIT_PROMPT_CLEAN="$fg[green]"