3 ZSH_THEME_GIT_PROMPT_PREFIX="%{$grey%}("
4 ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
5 ZSH_THEME_GIT_PROMPT_DIRTY="%{$grey%}) %{$fg[yellow]%}✗%{$reset_color%}"
6 ZSH_THEME_GIT_PROMPT_CLEAN="%{$grey%})"
9 (( spare_width = ${COLUMNS} ))
12 branch=$(current_branch)
13 ruby_version=$(rvm_prompt_info || rbenv_prompt_info)
15 branch_size=${#branch}
16 ruby_size=${#ruby_version}
17 user_machine_size=${#${(%):-%n@%m-}}
19 if [[ ${#branch} -eq 0 ]]
20 then (( ruby_size = ruby_size + 1 ))
22 (( branch_size = branch_size + 4 ))
23 if [[ -n $(git status -s 2> /dev/null) ]]; then
24 (( branch_size = branch_size + 2 ))
28 (( spare_width = ${spare_width} - (${user_machine_size} + ${path_size} + ${branch_size} + ${ruby_size}) ))
30 while [ ${#prompt} -lt $spare_width ]; do
34 prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%} $(git_prompt_info)"
43 %(?,%{%F{green}%},%{%F{red}%})⚡%{$reset_color%} '