diff --git a/zsh/oh-my-zsh/themes/laptop.zsh-theme b/zsh/oh-my-zsh/themes/laptop.zsh-theme index 6b3fef8..d9dd8a7 100644 --- a/zsh/oh-my-zsh/themes/laptop.zsh-theme +++ b/zsh/oh-my-zsh/themes/laptop.zsh-theme @@ -45,9 +45,18 @@ else fi # 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 current_dir='$PR_BOLD%{$PR_BLUE%}%~%{$PR_NO_COLOR%}' +local current_dir='$PR_BOLD%{$PR_BLUE%}$(truncated_pwd)$PR_NO_COLOR%}' local rvm_ruby='' if which rvm-prompt &> /dev/null; then rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}'