essembeh.zsh-theme 1.2 KB

123456789101112131415161718192021222324252627282930
  1. # Theme with full path names and hostname
  2. # Handy if you work on different servers all the time;
  3. local return_code="%(?..%{$fg_bold[red]%}%? ↵%{$reset_color%})"
  4. function my_git_prompt_info() {
  5. ref=$(git symbolic-ref HEAD 2> /dev/null) || return
  6. GIT_STATUS=$(git_prompt_status)
  7. [[ -n $GIT_STATUS ]] && GIT_STATUS=" $GIT_STATUS"
  8. echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$GIT_STATUS$ZSH_THEME_GIT_PROMPT_SUFFIX"
  9. }
  10. # Colored prompt
  11. ZSH_THEME_COLOR_USER="green"
  12. ZSH_THEME_COLOR_HOST="green"
  13. ZSH_THEME_COLOR_PWD="yellow"
  14. test -n "$SSH_CONNECTION" && ZSH_THEME_COLOR_USER="red" && ZSH_THEME_COLOR_HOST="red"
  15. test `id -u` = 0 && ZSH_THEME_COLOR_USER="magenta" && ZSH_THEME_COLOR_HOST="magenta"
  16. PROMPT='%{$fg_bold[$ZSH_THEME_COLOR_USER]%}%n@%{$fg_bold[$ZSH_THEME_COLOR_HOST]%}%M%{$reset_color%}:%{$fg_bold[$ZSH_THEME_COLOR_PWD]%}%~%{$reset_color%} $(my_git_prompt_info)%(!.#.$) '
  17. RPS1="${return_code}"
  18. ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}("
  19. ZSH_THEME_GIT_PROMPT_SUFFIX=") %{$reset_color%}"
  20. ZSH_THEME_GIT_PROMPT_UNTRACKED="%%"
  21. ZSH_THEME_GIT_PROMPT_ADDED="+"
  22. ZSH_THEME_GIT_PROMPT_MODIFIED="*"
  23. ZSH_THEME_GIT_PROMPT_RENAMED="~"
  24. ZSH_THEME_GIT_PROMPT_DELETED="!"
  25. ZSH_THEME_GIT_PROMPT_UNMERGED="?"