fino.zsh-theme 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. local box="${SHORT_HOST:-$HOST}"
  19. [[ -f ~/.box-name ]] && box="$(< ~/.box-name)"
  20. echo "${box:gs/%/%%}"
  21. }
  22. local ruby_env='$(ruby_prompt_info)'
  23. local git_info='$(git_prompt_info)'
  24. local virtualenv_info='$(virtualenv_prompt_info)'
  25. local prompt_char='$(prompt_char)'
  26. PROMPT="╭─${FG[040]}%n ${FG[239]}at ${FG[033]}$(box_name) ${FG[239]}in %B${FG[226]}%~%b${git_info}${ruby_env}${virtualenv_info}
  27. ╰─${prompt_char}%{$reset_color%} "
  28. ZSH_THEME_GIT_PROMPT_PREFIX=" ${FG[239]}on%{$reset_color%} ${FG[255]}"
  29. ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
  30. ZSH_THEME_GIT_PROMPT_DIRTY="${FG[202]}✘✘✘"
  31. ZSH_THEME_GIT_PROMPT_CLEAN="${FG[040]}✔"
  32. ZSH_THEME_RUBY_PROMPT_PREFIX=" ${FG[239]}using${FG[243]} ‹"
  33. ZSH_THEME_RUBY_PROMPT_SUFFIX="›%{$reset_color%}"
  34. export VIRTUAL_ENV_DISABLE_PROMPT=1
  35. ZSH_THEME_VIRTUALENV_PREFIX=" ${FG[239]}using${FG[243]} «"
  36. ZSH_THEME_VIRTUALENV_SUFFIX="»%{$reset_color%}"