fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
867946468
master
1# name: Informative Vcs 2# author: Mariusz Smykula <mariuszs at gmail.com> 3 4function fish_prompt --description'Write out the prompt' 5set -l last_pipestatus$pipestatus 6set -lx __fish_last_status$status # Export for __fish_print_pipestatus. 7 8if not set -q __fish_git_prompt_show_informative_status 9set -g __fish_git_prompt_show_informative_status1 10end 11if not set -q __fish_git_prompt_hide_untrackedfiles 12set -g __fish_git_prompt_hide_untrackedfiles1 13end 14if not set -q __fish_git_prompt_color_branch 15set -g __fish_git_prompt_color_branch magenta --bold 16end 17if not set -q __fish_git_prompt_showupstream 18set -g __fish_git_prompt_showupstream informative 19end 20if not set -q __fish_git_prompt_color_dirtystate 21set -g __fish_git_prompt_color_dirtystate blue 22end 23if not set -q __fish_git_prompt_color_stagedstate 24set -g __fish_git_prompt_color_stagedstate yellow 25end 26if not set -q __fish_git_prompt_color_invalidstate 27set -g __fish_git_prompt_color_invalidstate red 28end 29if not set -q __fish_git_prompt_color_untrackedfiles 30set -g __fish_git_prompt_color_untrackedfiles$fish_color_normal 31end 32if not set -q __fish_git_prompt_color_cleanstate 33set -g __fish_git_prompt_color_cleanstate green --bold 34end 35 36set -l color_cwd 37set -l suffix 38if functions -q fish_is_root_user;and fish_is_root_user 39if set -q fish_color_cwd_root 40set color_cwd$fish_color_cwd_root 41else 42set color_cwd$fish_color_cwd 43end 44set suffix'#' 45else 46set color_cwd$fish_color_cwd 47set suffix'$' 48end 49 50# PWD 51set_color $color_cwd 52echo -n( prompt_pwd ) 53set_color --reset 54 55printf '%s ' ( fish_vcs_prompt ) 56 57set -l status_color( set_color $fish_color_status ) 58set -l statusb_color( set_color --bold$fish_color_status ) 59set -l prompt_status( __fish_print_pipestatus "[" "]" "|" " $status_color " " $statusb_color " $last_pipestatus ) 60echo -n$prompt_status 61set_color --reset 62 63echo -n" $suffix " 64end