my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.1 KiB

3 years ago
  1. # ZSH Theme emulating the Fish shell's default prompt.
  2. _fishy_collapsed_wd() {
  3. local i pwd
  4. pwd=("${(s:/:)PWD/#$HOME/~}")
  5. if (( $#pwd > 1 )); then
  6. for i in {1..$(($#pwd-1))}; do
  7. if [[ "$pwd[$i]" = .* ]]; then
  8. pwd[$i]="${${pwd[$i]}[1,2]}"
  9. else
  10. pwd[$i]="${${pwd[$i]}[1]}"
  11. fi
  12. done
  13. fi
  14. echo "${(j:/:)pwd}"
  15. }
  16. local user_color='green'; [ $UID -eq 0 ] && user_color='red'
  17. PROMPT='%n@%m %{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>) '
  18. PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
  19. local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}"
  20. RPROMPT="${RPROMPT}"'${return_status}$(git_prompt_info)$(git_prompt_status)%{$reset_color%}'
  21. ZSH_THEME_GIT_PROMPT_PREFIX=" "
  22. ZSH_THEME_GIT_PROMPT_SUFFIX=""
  23. ZSH_THEME_GIT_PROMPT_DIRTY=""
  24. ZSH_THEME_GIT_PROMPT_CLEAN=""
  25. ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}+"
  26. ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[blue]%}!"
  27. ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}-"
  28. ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[magenta]%}>"
  29. ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[yellow]%}#"
  30. ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[cyan]%}?"