35 lines
859 B
Bash
35 lines
859 B
Bash
#!/bin/false
|
|
|
|
function my_pwd {
|
|
# ~ for home; keep only the last two directories
|
|
echo $(echo "$PWD" | sed -r '
|
|
s,^'"$HOME"',~,
|
|
s|^.+/([^/]*/[^/]*)$|\1|
|
|
:end')
|
|
}
|
|
|
|
function my_retval {
|
|
RETVAL=$?
|
|
|
|
if [[ $RETVAL -eq 0 ]]; then
|
|
echo "$fg[yellow]"
|
|
else
|
|
echo "$fg[red]$RETVAL "
|
|
fi
|
|
}
|
|
|
|
PROMPT='%{$(my_retval)%}$(my_pwd)$(git_prompt_info)$(git_prompt_status) %{$reset_color%} '
|
|
|
|
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%} "
|
|
ZSH_THEME_GIT_PROMPT_SUFFIX=""
|
|
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
|
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
|
ZSH_THEME_GIT_PROMPT_ADDED=" %{$fg[cyan]%}+"
|
|
ZSH_THEME_GIT_PROMPT_MODIFIED=" %{$fg[yellow]%}✭"
|
|
ZSH_THEME_GIT_PROMPT_DELETED=" %{$fg[red]%}✗"
|
|
ZSH_THEME_GIT_PROMPT_RENAMED=" %{$fg[blue]%}➦"
|
|
ZSH_THEME_GIT_PROMPT_UNMERGED=" %{$fg[magenta]%}✂"
|
|
ZSH_THEME_GIT_PROMPT_UNTRACKED=" %{$fg[grey]%}✱"
|
|
|
|
|
|
# vim: set ft=zsh noet :
|