2018-08-20 22:37:45 +02:00
|
|
|
#!/bin/false
|
2018-08-20 04:18:36 +02:00
|
|
|
|
2018-08-20 22:37:45 +02:00
|
|
|
function my_pwd {
|
|
|
|
# ~ for home; keep only the last two directories
|
|
|
|
echo $(echo "$PWD" | sed -r '
|
2018-09-03 10:56:21 +02:00
|
|
|
s,^'"$HOME"',~,; t reset; :reset
|
|
|
|
s|^~/git/my-cool-project/([^/])[^/]+/([^/]+)/|\1/\2/|; t end
|
2018-08-20 22:37:45 +02:00
|
|
|
s|^.+/([^/]*/[^/]*)$|\1|
|
|
|
|
:end')
|
|
|
|
}
|
|
|
|
|
2018-08-20 23:57:21 +02:00
|
|
|
function my_retval {
|
|
|
|
RETVAL=$?
|
|
|
|
|
|
|
|
if [[ $RETVAL -eq 0 ]]; then
|
2018-09-03 10:56:21 +02:00
|
|
|
echo "%{$fg[yellow]%}"
|
2018-08-20 23:57:21 +02:00
|
|
|
else
|
2018-09-03 10:56:21 +02:00
|
|
|
echo "%{$fg[red]%}$RETVAL "
|
2018-08-20 23:57:21 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-09-03 10:56:21 +02:00
|
|
|
PROMPT='$(my_retval)$(my_pwd)$(git_prompt_info)$(git_prompt_status) %{$reset_color%} '
|
2018-08-20 04:18:36 +02:00
|
|
|
|
|
|
|
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]%}✱"
|
2018-08-20 22:37:45 +02:00
|
|
|
|
2018-09-03 10:56:21 +02:00
|
|
|
ZSH_THEME_TERM_TAB_TITLE_IDLE="in %~" # NOT truncated PWD
|
|
|
|
|
2018-08-20 22:37:45 +02:00
|
|
|
|
|
|
|
# vim: set ft=zsh noet :
|