Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ~/.config/fish/functions/fish_prompt.fish
- function fish_prompt --description 'Write out the prompt'
- # Just calculate these once, to save a few cycles when displaying the prompt
- if not set -q __fish_prompt_normal
- set -g __fish_prompt_normal (set_color normal)
- end
- set -l delim '$'
- switch $USER
- case root
- if not set -q __fish_prompt_cwd
- if set -q fish_color_cwd_root
- set -g __fish_prompt_cwd (set_color $fish_color_cwd_root)
- else
- set -g __fish_prompt_cwd (set_color $fish_color_cwd)
- end
- end
- case '*'
- if not set -q __fish_prompt_cwd
- set -g __fish_prompt_cwd (set_color $fish_color_cwd)
- end
- end
- set -g __fish_git_prompt_showdirtystate 1
- set -g __fish_git_prompt_color purple
- echo -n -s "$__fish_prompt_cwd" (prompt_pwd) (__fish_git_prompt) "$__fish_prompt_normal" ' ' "$delim" ' '
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement