diff options
author | Hugues Hiegel <hugues.hiegel@qosmos.com> | 2012-03-08 13:35:02 +0100 |
---|---|---|
committer | Hugues Hiegel <hugues.hiegel@qosmos.com> | 2012-03-08 13:35:08 +0100 |
commit | bd2cf0596e034faa04528658e0355ac4ed319871 (patch) | |
tree | 701d2f8e0b5cecd2a0b8ea1c1bfa05966dc27698 /12_Prompts.zsh | |
parent | dc2abe342ec7e0d674ea7c510566aba5a6b37f1e (diff) |
[Prompt] better VCS subdir managment
Diffstat (limited to '12_Prompts.zsh')
-rw-r--r-- | 12_Prompts.zsh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/12_Prompts.zsh b/12_Prompts.zsh index 857e042..e77cf4b 100644 --- a/12_Prompts.zsh +++ b/12_Prompts.zsh @@ -286,9 +286,14 @@ __update_prompt_elements() #VCSBRANCH=$C_$_prompt_colors[soft_generic]$_C${${VCSBRANCH/→/$C_"30"$_C}/←/$C_$_prompt_colors[soft_generic]$_C}"$C_$color[none]$_C" fi - [ -n "$VCSROOT" ] && CURDIR=${CURDIR/$VCSROOT*/$VCSROOT} + SUBDIR="" + if [ -n "$VCSROOT" ] + then + SUBDIR=${CURDIR/$VCSROOT\//} + CURDIR=${CURDIR/\/$SUBDIR/} + fi CURDIR="$C_$_prompt_colors[path]$_C%`echo $spaceleft`<..<"$CURDIR"%<<$C_$color[none]$_C" - [ "$VCSSUBDIR" != "." ] && CURDIR+=$C_$color[cyan]";"$color[bold]$_C"/"$C_$_prompt_colors[path]$_C$VCSSUBDIR + [ "$VCSSUBDIR" = "$SUBDIR" ] && CURDIR+=$C_$color[cyan]";"$color[bold]$_C"/"$C_$_prompt_colors[path]$_C$VCSSUBDIR [ "$DEBUG" = "yes" ] && echo } |