Skip to content

Commit

Permalink
Added my own theme based on pat's
Browse files Browse the repository at this point in the history
  • Loading branch information
joshprice authored and robbyrussell committed Aug 19, 2010
1 parent 7c27985 commit eb14ee1
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions themes/josh.zsh-theme
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
grey='\e[0;90m'

ZSH_THEME_GIT_PROMPT_PREFIX="%{$grey%}("
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$grey%}) %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$grey%})"

function pat_prompt {
(( spare_width = ${COLUMNS} ))
prompt=" "

branch=$(current_branch)
ruby_version=$(rvm_prompt_info)
path_size=${#PWD}
branch_size=${#branch}
ruby_size=${#ruby_version}
machine_size=11

if [[ ${#branch} -eq 0 ]]
then (( ruby_size = ruby_size + 1 ))
else
(( branch_size = branch_size + 4 ))
if [[ -n $(git status -s 2> /dev/null) ]]; then
(( branch_size = branch_size + 2 ))
fi
fi

(( spare_width = ${spare_width} - (${machine_size} + ${path_size} + ${branch_size} + ${ruby_size}) ))

while [ ${#prompt} -lt $spare_width ]; do
prompt=" $prompt"
done

prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info)%{$reset_color%} $(git_prompt_info)"

echo $prompt
}

setopt prompt_subst

PROMPT='
%n@%m $(pat_prompt)
%(?,%{%F{green}%},%{%F{red}%})⚡%{$reset_color%} '

0 comments on commit eb14ee1

Please sign in to comment.