Clean prompt and fix git integration

This commit is contained in:
Henrik Lissner 2013-03-16 14:29:30 -04:00
parent 1cfb22ac59
commit 78cecdae88

View file

@ -1,8 +1,38 @@
#!/bin/bash #!/bin/bash
PROMPT=" function short_pwd() {
%{$FX[bold]%}%{$fg[cyan]%}%{$BG[234]%}> " SHORTPWD=`print -Pn "%4~"`
RPROMPT="%~$(git_prompt_info) @ %{$fg[white]%}$(hostname)%{$reset_color%}" [[ "${SHORT_PWD:0:1}" =~ "[^/~]" ]] && SHORT_PWD=".../$SHORT_PWD"
ZSH_THEME_GIT_PROMPT_PREFIX="[" echo $SHORTPWD
ZSH_THEME_GIT_PROMPT_SUFFIX="]" }
# GIT Stuff
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[white]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}+%{$fg[white]%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
##################
# Build Prompt #
##################
# Left side
PROMPT="
"
if [[ -n $SSH_CLIENT ]]; then
PROMPT+="%{$fg[white]%}$(hostname)%{$reset_color%} "
fi
PROMPT+="%{$FX[bold]%}"
PROMPT+="%{$fg[cyan]%}"
PROMPT+="%{$BG[234]%}"
PROMPT+="$ "
PROMPT+="%{$fg[white]%}"
# Right side
RPROMPT="%{$fg[cyan]%}"
RPROMPT+='$(short_pwd)'
RPROMPT+='$(git_prompt_info)'
RPROMPT+='%{$reset_color%}'