-
Notifications
You must be signed in to change notification settings - Fork 0
/
fish_prompt.fish
40 lines (38 loc) · 1.07 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
function fish_prompt
set -l last_status $status
set -l dir (prompt_pwd)
set -l branch (command git symbolic-ref HEAD 2> /dev/null | sed -e 's|^refs/heads/||')
set -l bwhite (set_color --bold white)
set -l blblue (set_color --bold 02f4f4)
set -l bteal (set_color --bold 02f4c0)
set -l bgreen (set_color --bold green)
set -l hostnamecolour (set_color --bold c5f9f9)
set_color --bold white
#if test "$status" = "0"
# set -l stcolour (set_color --bold green)
# set -l last_stat (printf )
#else
# set -l stcolour (set_color --bold red)
# set -l last_stat (printf $status )
#end
printf "\n "
printf "$bteal $USER"
printf "$bwhite@$hostnamecolour$(hostname) "
printf "$blblue $dir "
if not test "$last_status" -eq 0
set_color --bold red
printf "$last_status "
set_color --bold white
else
set_color --bold green
printf ""
set_color --bold white
end
set_color --bold white
printf " \n"
if test -n "$branch"
set_color --bold green
printf " $branch "
end
printf " "
end