crunch.zsh-theme 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # CRUNCH - created from Steve Eley's cat waxing.
  2. # Initially hacked from the Dallas theme. Thanks, Dallas Reedy.
  3. #
  4. # This theme assumes you do most of your oh-my-zsh'ed "colorful" work at a single machine,
  5. # and eschews the standard space-consuming user and hostname info. Instead, only the
  6. # things that vary in my own workflow are shown:
  7. #
  8. # * The time (not the date)
  9. # * The RVM version and gemset (omitting the 'ruby' name if it's MRI)
  10. # * The current directory
  11. # * The Git branch and its 'dirty' state
  12. #
  13. # Colors are at the top so you can mess with those separately if you like.
  14. # For the most part I stuck with Dallas's.
  15. CRUNCH_BRACKET_COLOR="%{$fg[white]%}"
  16. CRUNCH_TIME_COLOR="%{$fg[yellow]%}"
  17. CRUNCH_RVM_COLOR="%{$fg[magenta]%}"
  18. CRUNCH_DIR_COLOR="%{$fg[cyan]%}"
  19. CRUNCH_GIT_BRANCH_COLOR="%{$fg[green]%}"
  20. CRUNCH_GIT_CLEAN_COLOR="%{$fg[green]%}"
  21. CRUNCH_GIT_DIRTY_COLOR="%{$fg[red]%}"
  22. # These Git variables are used by the oh-my-zsh git_prompt_info helper:
  23. ZSH_THEME_GIT_PROMPT_PREFIX="$CRUNCH_BRACKET_COLOR:$CRUNCH_GIT_BRANCH_COLOR"
  24. ZSH_THEME_GIT_PROMPT_SUFFIX=""
  25. ZSH_THEME_GIT_PROMPT_CLEAN=" $CRUNCH_GIT_CLEAN_COLOR✓"
  26. ZSH_THEME_GIT_PROMPT_DIRTY=" $CRUNCH_GIT_DIRTY_COLOR✗"
  27. # Our elements:
  28. CRUNCH_TIME_="$CRUNCH_BRACKET_COLOR{$CRUNCH_TIME_COLOR%T$CRUNCH_BRACKET_COLOR}%{$reset_color%}"
  29. if which rvm-prompt &> /dev/null; then
  30. CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(~/.rvm/bin/rvm-prompt i v g)#ruby-}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}"
  31. else
  32. if which rbenv &> /dev/null; then
  33. CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(rbenv version | sed -e 's/ (set.*$//' -e 's/^ruby-//')}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}"
  34. fi
  35. fi
  36. CRUNCH_DIR_="$CRUNCH_DIR_COLOR%~\$(git_prompt_info) "
  37. CRUNCH_PROMPT="$CRUNCH_BRACKET_COLOR➭ "
  38. # Put it all together!
  39. PROMPT="$CRUNCH_TIME_$CRUNCH_RVM_$CRUNCH_DIR_$CRUNCH_PROMPT%{$reset_color%}"