Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. # ~/.config/fish/functions/fish_prompt.fish
  2.  
  3. function fish_prompt --description 'Write out the prompt'
  4. # Just calculate these once, to save a few cycles when displaying the prompt
  5.  
  6. if not set -q __fish_prompt_normal
  7. set -g __fish_prompt_normal (set_color normal)
  8. end
  9.  
  10. set -l delim '$'
  11.  
  12. switch $USER
  13.  
  14. case root
  15.  
  16. if not set -q __fish_prompt_cwd
  17. if set -q fish_color_cwd_root
  18. set -g __fish_prompt_cwd (set_color $fish_color_cwd_root)
  19. else
  20. set -g __fish_prompt_cwd (set_color $fish_color_cwd)
  21. end
  22. end
  23.  
  24. case '*'
  25.  
  26. if not set -q __fish_prompt_cwd
  27. set -g __fish_prompt_cwd (set_color $fish_color_cwd)
  28. end
  29.  
  30. end
  31.  
  32. set -g __fish_git_prompt_showdirtystate 1
  33. set -g __fish_git_prompt_color purple
  34.  
  35. echo -n -s "$__fish_prompt_cwd" (prompt_pwd) (__fish_git_prompt) "$__fish_prompt_normal" ' ' "$delim" ' '
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement