af-magic.zsh-theme 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # af-magic.zsh-theme
  2. # Repo: https://github.com/andyfleming/oh-my-zsh
  3. # Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme
  4. # settings
  5. typeset +H return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
  6. typeset +H my_gray="$FG[237]"
  7. typeset +H my_orange="$FG[214]"
  8. # separator dashes size
  9. function afmagic_dashes {
  10. [[ -n "${VIRTUAL_ENV-}" && -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" && "$PS1" = \(* ]] \
  11. && echo $(( COLUMNS - ${#VIRTUAL_ENV} - 3 )) \
  12. || echo $COLUMNS
  13. }
  14. # primary prompt
  15. PS1='$FG[237]${(l.$(afmagic_dashes)..-.)}%{$reset_color%}
  16. $FG[032]%~$(git_prompt_info)$(hg_prompt_info) $FG[105]%(!.#.»)%{$reset_color%} '
  17. PS2='%{$fg[red]%}\ %{$reset_color%}'
  18. RPS1='${return_code}'
  19. # right prompt
  20. (( $+functions[virtualenv_prompt_info] )) && RPS1+='$(virtualenv_prompt_info)'
  21. RPS1+=' $my_gray%n@%m%{$reset_color%}%'
  22. # git settings
  23. ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075]($FG[078]"
  24. ZSH_THEME_GIT_PROMPT_CLEAN=""
  25. ZSH_THEME_GIT_PROMPT_DIRTY="$my_orange*%{$reset_color%}"
  26. ZSH_THEME_GIT_PROMPT_SUFFIX="$FG[075])%{$reset_color%}"
  27. # hg settings
  28. ZSH_THEME_HG_PROMPT_PREFIX="$FG[075]($FG[078]"
  29. ZSH_THEME_HG_PROMPT_CLEAN=""
  30. ZSH_THEME_HG_PROMPT_DIRTY="$my_orange*%{$reset_color%}"
  31. ZSH_THEME_HG_PROMPT_SUFFIX="$FG[075])%{$reset_color%}"
  32. # virtualenv settings
  33. ZSH_THEME_VIRTUALENV_PREFIX=" $FG[075]["
  34. ZSH_THEME_VIRTUALENV_SUFFIX="]%{$reset_color%}"