thomasjbradley.zsh-theme 1.1 KB

1234567891011121314151617181920212223242526272829
  1. function prompt_char {
  2. git branch >/dev/null 2>/dev/null && echo '±' && return
  3. hg root >/dev/null 2>/dev/null && echo '☿' && return
  4. echo '○'
  5. }
  6. function virtualenv_info {
  7. [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
  8. }
  9. function hg_prompt_info {
  10. hg prompt --angle-brackets "\
  11. < on %{$fg[magenta]%}<branch>%{$reset_color%}>\
  12. < at %{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\
  13. %{$fg[green]%}<status|modified|unknown><update>%{$reset_color%}<
  14. patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null
  15. }
  16. PROMPT='
  17. %{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info)
  18. $(virtualenv_info)$(prompt_char) '
  19. ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
  20. ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
  21. ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!"
  22. ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
  23. ZSH_THEME_GIT_PROMPT_CLEAN=""
  24. . ~/bin/dotfiles/zsh/aliases