Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. function fish_prompt
  2.  
  3. printf '\n'
  4.  
  5. set_color $fish_color_cwd_root
  6. printf ' '
  7.  
  8. # print base dir
  9.  
  10. if test $PWD = "/" >/dev/null ^/dev/null
  11. set_color --bold $fish_color_cwd_root
  12. printf \/
  13. else if test $PWD = $HOME >/dev/null ^/dev/null
  14. set_color --bold blue
  15. printf \~
  16. else
  17. set_color --bold blue
  18. printf (basename $PWD)
  19. end
  20. printf ' '
  21.  
  22.  
  23. # print git status
  24.  
  25. if git rev-parse --is-inside-work-tree >/dev/null ^/dev/null
  26.  
  27. if test -z (git status --porcelain) >/dev/null ^/dev/null
  28.  
  29. # print clean status
  30.  
  31. set_color normal
  32. printf ' '
  33. printf (git symbolic-ref --short HEAD; or false); printf ' '
  34.  
  35. else
  36.  
  37. # print dirty status
  38.  
  39. set_color normal
  40. set_color yellow
  41. printf ' '
  42. printf (git symbolic-ref --short HEAD; or false); printf ' '
  43.  
  44. end
  45. end
  46. printf ' '
  47.  
  48. # print indicator
  49.  
  50. set_color normal
  51. printf '⋅ '
  52.  
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement