Guest User

Untitled

a guest
Oct 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. fish_prompt is a function with definition
  2. function fish_prompt --description 'Write out the prompt'
  3. set last_ret $status
  4. # Just calculate these once, to save a few cycles when displaying the prompt
  5. if not set -q __fish_prompt_hostname
  6. set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
  7. end
  8.  
  9. if not set -q __fish_prompt_normal
  10. set -g __fish_prompt_normal (set_color normal)
  11. end
  12.  
  13. if not set -q __fish_prompt_cwd
  14. set -g __fish_prompt_cwd (set_color $fish_color_cwd)
  15. end
  16.  
  17. if not set -q __fish_prompt_colors
  18. set -g __fish_prompt_color_red (set_color -o red)
  19. set -g __fish_prompt_color_yellow (set_color -o yellow)
  20. set -g __fish_prompt_color_green (set_color -o green)
  21. end
  22.  
  23. printf '%s[%s%s%s] %s%s@%s %s%s%s%s%s> ' "$__fish_prompt_color_red" "$__fish_prompt_color_yellow" $last_ret "$__fish_prompt_color_red" "$__fish_prompt_color_green" $USER $__fish_prompt_hostname "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_color_yellow" (__fish_git_branch_prompt) "$__fish_prompt_normal"
  24. end
Add Comment
Please, Sign In to add comment