fishy.zsh-theme 920 B

123456789101112131415161718192021222324
  1. # ZSH Theme emulating the Fish shell's default prompt.
  2. _fishy_collapsed_wd() {
  3. echo $(pwd | perl -pe "s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g")
  4. }
  5. local user_color='green'; [ $UID -eq 0 ] && user_color='red'
  6. PROMPT='%n@%m %{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>) '
  7. PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
  8. local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}"
  9. RPROMPT='${return_status}$(git_prompt_info)$(git_prompt_status)%{$reset_color%}'
  10. ZSH_THEME_GIT_PROMPT_PREFIX=" "
  11. ZSH_THEME_GIT_PROMPT_SUFFIX=""
  12. ZSH_THEME_GIT_PROMPT_DIRTY=""
  13. ZSH_THEME_GIT_PROMPT_CLEAN=""
  14. ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}+"
  15. ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[blue]%}!"
  16. ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}-"
  17. ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[magenta]%}>"
  18. ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[yellow]%}#"
  19. ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[cyan]%}?"