fino.zsh-theme 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # fino.zsh-theme
  2. # Use with a dark background and 256-color terminal!
  3. # Meant for people with rbenv and git. Tested only on OS X 10.7.
  4. # You can set your computer name in the ~/.box-name file if you want.
  5. # Borrowing shamelessly from these oh-my-zsh themes:
  6. # bira
  7. # robbyrussell
  8. #
  9. # Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/
  10. function virtualenv_prompt_info {
  11. [[ -n ${VIRTUAL_ENV} ]] || return
  12. echo "${ZSH_THEME_VIRTUALENV_PREFIX:=[}${VIRTUAL_ENV:t}${ZSH_THEME_VIRTUALENV_SUFFIX:=]}"
  13. }
  14. function prompt_char {
  15. command git branch &>/dev/null && echo "±" || echo '○'
  16. }
  17. function box_name {
  18. [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST}
  19. }
  20. local ruby_env='$(ruby_prompt_info)'
  21. local git_info='$(git_prompt_info)'
  22. local virtualenv_info='$(virtualenv_prompt_info)'
  23. local prompt_char='$(prompt_char)'
  24. PROMPT="╭─${FG[040]}%n ${FG[239]}at ${FG[033]}$(box_name) ${FG[239]}in %B${FG[226]}%~%b${git_info}${ruby_env}${virtualenv_info}
  25. ╰─${prompt_char}%{$reset_color%} "
  26. ZSH_THEME_GIT_PROMPT_PREFIX=" ${FG[239]}on%{$reset_color%} ${FG[255]}"
  27. ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
  28. ZSH_THEME_GIT_PROMPT_DIRTY="${FG[202]}✘✘✘"
  29. ZSH_THEME_GIT_PROMPT_CLEAN="${FG[040]}✔"
  30. ZSH_THEME_RUBY_PROMPT_PREFIX=" ${FG[239]}using${FG[243]} ‹"
  31. ZSH_THEME_RUBY_PROMPT_SUFFIX="›%{$reset_color%}"
  32. export VIRTUAL_ENV_DISABLE_PROMPT=1
  33. ZSH_THEME_VIRTUALENV_PREFIX=" ${FG[239]}using${FG[243]} «"
  34. ZSH_THEME_VIRTUALENV_SUFFIX="»%{$reset_color%}"