linuxonly.zsh-theme 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # vim: set ts=2 textwidth=0
  2. autoload -U add-zsh-hook
  3. autoload -Uz vcs_info
  4. local c0=$(printf "\033[0m")
  5. local c1=$(printf "\033[38;5;215m")
  6. local c2=$(printf "\033[38;5;209m")
  7. local c3=$(printf "\033[38;5;203m")
  8. local c4=$(printf "\033[33;4m")
  9. local c5=$(printf "\033[38;5;137m")
  10. local c6=$(printf "\033[38;5;240m")
  11. local c7=$(printf "\033[38;5;149m")
  12. local c8=$(printf "\033[38;5;126m")
  13. local c9=$(printf "\033[38;5;162m")
  14. if [ "$TERM" = "linux" ]; then
  15. c1=$(printf "\033[34;1m")
  16. c2=$(printf "\033[35m")
  17. c3=$(printf "\033[31m")
  18. c4=$(printf "\033[31;1m")
  19. c5=$(printf "\033[32m")
  20. c6=$(printf "\033[32;1m")
  21. c7=$(printf "\033[33m")
  22. c8=$(printf "\033[33;1m")
  23. c9=$(printf "\033[34m")
  24. fi
  25. #local newtv=$(perl $HOME/devel/newtv.pl)
  26. local newtv=''
  27. zstyle ':vcs_info:*' actionformats \
  28. '%{$c8%}(%f%s)%{$c7%}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
  29. zstyle ':vcs_info:*' formats \
  30. "%{$c8%}%s%{$c7%}:%{$c7%}(%{$c9%}%b%{$c7%})%f "
  31. zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
  32. zstyle ':vcs_info:*' enable git
  33. add-zsh-hook precmd prompt_jnrowe_precmd
  34. prompt_jnrowe_precmd () {
  35. vcs_info
  36. if [ "${vcs_info_msg_0_}" = "" ]; then
  37. #dir_status="|%F{3}%n%F{7}@%F{3}%m%F{7}:%F{9}%l%f"
  38. #dir_status="$c1%n%F{7}@%F{9}%m%F{7}:%F{12}%/"
  39. dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})"
  40. #dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$foopath%} %{$c0%}(%{$c5%}%?%{$c0%})"
  41. PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%}
  42. > '
  43. elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then
  44. dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})"
  45. PROMPT='${vcs_info_msg_0_}
  46. %{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%}
  47. > '
  48. elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then
  49. dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})"
  50. PROMPT='${vcs_info_msg_0_}
  51. %{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%}
  52. %{$c9%}·>%{$c0%} '
  53. else
  54. dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})"
  55. PROMPT='${vcs_info_msg_0_}
  56. %{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%}
  57. > '
  58. fi
  59. }
  60. #PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$reset_color%} ${vcs_info_msg_0_}${dir_status}%{$reset_color%}
  61. #> '
  62. # vim: set ft=zsh ts=4 sw=4 et: