suvash.zsh-theme 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. function prompt_char {
  2. git branch >/dev/null 2>/dev/null && echo '±' && return
  3. hg root >/dev/null 2>/dev/null && echo 'Hg' && return
  4. echo '○'
  5. }
  6. function virtualenv_info {
  7. [[ -n "$VIRTUAL_ENV" ]] && echo '('${VIRTUAL_ENV:t}') '
  8. }
  9. function ruby_prompt {
  10. if (( $+commands[rvm-prompt] )); then
  11. print -n $ZSH_THEME_RUBY_PROMPT_PREFIX
  12. print -n $(~/.rvm/bin/rvm-prompt)
  13. print -n $ZSH_THEME_RUBY_PROMPT_SUFFIX
  14. elif (( $+commands[rbenv] )); then
  15. print -n $ZSH_THEME_RUBY_PROMPT_PREFIX
  16. print -n $(rbenv version | sed -e "s/ (set.*$//")
  17. print -n $ZSH_THEME_RUBY_PROMPT_SUFFIX
  18. fi
  19. return 0
  20. }
  21. PROMPT='%F{magenta}%n%f at %F{yellow}%m%f in %B%F{green}%~%f%b$(git_prompt_info)$(ruby_prompt)
  22. $(virtualenv_info) $(prompt_char) '
  23. ZSH_THEME_GIT_PROMPT_PREFIX=' on %F{magenta}'
  24. ZSH_THEME_GIT_PROMPT_SUFFIX='%f'
  25. ZSH_THEME_GIT_PROMPT_DIRTY='%F{green}!'
  26. ZSH_THEME_GIT_PROMPT_UNTRACKED='%F{green}?'
  27. ZSH_THEME_GIT_PROMPT_CLEAN=''
  28. ZSH_THEME_RUBY_PROMPT_PREFIX=' using %F{red}'
  29. ZSH_THEME_RUBY_PROMPT_SUFFIX='%f'