forked from brandonweiss/pure.fish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fish_prompt.fish
45 lines (36 loc) · 1.06 KB
/
fish_prompt.fish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
set fish_prompt_pwd_dir_length 0
# Git prompt
set __fish_git_prompt_showdirtystate 'yes'
set __fish_git_prompt_showupstream 'yes'
set __fish_git_prompt_color_branch 242
set __fish_git_prompt_color_dirtystate FCBC47
set __fish_git_prompt_color_stagedstate green
set __fish_git_prompt_color_upstream cyan
# Git Characters
set __fish_git_prompt_char_dirtystate '*'
set __fish_git_prompt_char_stagedstate '⇢'
set __fish_git_prompt_char_upstream_prefix ' '
set __fish_git_prompt_char_upstream_equal ''
set __fish_git_prompt_char_upstream_ahead '⇡'
set __fish_git_prompt_char_upstream_behind '⇣'
set __fish_git_prompt_char_upstream_diverged '⇡⇣'
function _print_in_color
set -l string $argv[1]
set -l color $argv[2]
set_color $color
printf $string
set_color normal
end
function _prompt_color_for_status
if test $argv[1] -eq 0
echo magenta
else
echo red
end
end
function fish_prompt
set -l last_status $status
_print_in_color "\n"(prompt_pwd) blue
__fish_git_prompt " %s"
_print_in_color "\n❯ " (_prompt_color_for_status $last_status)
end