[zsh-theme] Fix issues
This commit is contained in:
parent
5d1d0da059
commit
7e207c402e
1 changed files with 7 additions and 4 deletions
|
@ -3,7 +3,8 @@
|
|||
function my_pwd {
|
||||
# ~ for home; keep only the last two directories
|
||||
echo $(echo "$PWD" | sed -r '
|
||||
s,^'"$HOME"',~,
|
||||
s,^'"$HOME"',~,; t reset; :reset
|
||||
s|^~/git/my-cool-project/([^/])[^/]+/([^/]+)/|\1/\2/|; t end
|
||||
s|^.+/([^/]*/[^/]*)$|\1|
|
||||
:end')
|
||||
}
|
||||
|
@ -12,13 +13,13 @@ function my_retval {
|
|||
RETVAL=$?
|
||||
|
||||
if [[ $RETVAL -eq 0 ]]; then
|
||||
echo "$fg[yellow]"
|
||||
echo "%{$fg[yellow]%}"
|
||||
else
|
||||
echo "$fg[red]$RETVAL "
|
||||
echo "%{$fg[red]%}$RETVAL "
|
||||
fi
|
||||
}
|
||||
|
||||
PROMPT='%{$(my_retval)%}$(my_pwd)$(git_prompt_info)$(git_prompt_status) %{$reset_color%} '
|
||||
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=""
|
||||
|
@ -31,5 +32,7 @@ ZSH_THEME_GIT_PROMPT_RENAMED=" %{$fg[blue]%}➦"
|
|||
ZSH_THEME_GIT_PROMPT_UNMERGED=" %{$fg[magenta]%}✂"
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED=" %{$fg[grey]%}✱"
|
||||
|
||||
ZSH_THEME_TERM_TAB_TITLE_IDLE="in %~" # NOT truncated PWD
|
||||
|
||||
|
||||
# vim: set ft=zsh noet :
|
||||
|
|
Loading…
Reference in a new issue