Truncated pwd
This commit is contained in:
parent
93b879710b
commit
673279173d
|
@ -45,9 +45,18 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# local return_code="%(?..%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})"
|
# local return_code="%(?..%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})"
|
||||||
|
truncated_pwd() {
|
||||||
|
current_pwd=$(print -rD $PWD)
|
||||||
|
if [ ${#current_pwd} -gt 50 ]; then
|
||||||
|
last_dirs=`echo ${current_pwd: -50} | cut -d '/' -f 2-`
|
||||||
|
echo "~/.../${last_dirs}"
|
||||||
|
else
|
||||||
|
echo $current_pwd
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
local user_host='$PR_BOLD${PR_USER}$PR_BOLD'
|
local user_host='$PR_BOLD${PR_USER}$PR_BOLD'
|
||||||
local current_dir='$PR_BOLD%{$PR_BLUE%}%~%{$PR_NO_COLOR%}'
|
local current_dir='$PR_BOLD%{$PR_BLUE%}$(truncated_pwd)$PR_NO_COLOR%}'
|
||||||
local rvm_ruby=''
|
local rvm_ruby=''
|
||||||
if which rvm-prompt &> /dev/null; then
|
if which rvm-prompt &> /dev/null; then
|
||||||
rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}'
|
rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}'
|
||||||
|
|
Loading…
Reference in New Issue