summaryrefslogtreecommitdiff
path: root/12_Prompts.zsh
diff options
context:
space:
mode:
Diffstat (limited to '12_Prompts.zsh')
-rw-r--r--12_Prompts.zsh14
1 files changed, 13 insertions, 1 deletions
diff --git a/12_Prompts.zsh b/12_Prompts.zsh
index d49b947..48423a8 100644
--- a/12_Prompts.zsh
+++ b/12_Prompts.zsh
@@ -84,7 +84,19 @@ __update_prompt_elements()
__set_prompt_date
__hbar
- CURDIR=$C_$_prompt_colors[path]$_C"%(!.%d.%~)"$C_$color[none]$_C
+ CURDIR="%(!.%d.%~)"
+ __gitdir="$(readlink -m $( git rev-parse --git-dir 2>&- ) 2>&- | sed 's\'$HOME'\~\;s\/.git$\\')"
+ #print "#1# "$__gitdir
+ #print "#2# "$CURDIR
+ #print "#2# "$(print -Pn $CURDIR)
+ if [ -n "$__gitdir" ]
+ then
+ ___gitdir=$(dirname $__gitdir)"/"
+ [ $___gitdir == "./" ] && unset ___gitdir
+ CURDIR="$(print -Pn "$CURDIR" | sed "s*$__gitdir*$___gitdir${C_}$_prompt_colors[soft_generic];3$_C${__gitdir:t}$C_$_prompt_colors[path]$_C*")"
+ fi
+ #print "#3# "$CURDIR
+ CURDIR=$C_$_prompt_colors[path]$_C$CURDIR$C_$color[none]$_C
}