Sorin prompt: updates

Use $USER, prompt_hostname, string
Update to use correct color names such as magenta over purple.
Use bright color variants instead of bold in some cases.
This commit is contained in:
Aaron Gyes 2016-10-31 23:29:50 -07:00
parent 9701d5cc7b
commit c18614552d

View file

@ -2,7 +2,7 @@
# author: Ivan Tham <ivanthamjunhoe@gmail.com> # author: Ivan Tham <ivanthamjunhoe@gmail.com>
function fish_prompt function fish_prompt
test $SSH_TTY; and printf (set_color red)(whoami)(set_color white)'@'(set_color yellow)(hostname)' ' test $SSH_TTY; and printf (set_color red)$USER(set_color brwhite)'@'(set_color yellow)(prompt_hostname)' '
test $USER = 'root'; and echo (set_color red)"#" test $USER = 'root'; and echo (set_color red)"#"
@ -15,10 +15,10 @@ function fish_right_prompt
test $status != 0; and printf (set_color red)"⏎ " test $status != 0; and printf (set_color red)"⏎ "
if git rev-parse ^ /dev/null if git rev-parse ^ /dev/null
# Purple if branch detached else green # Magenta if branch detached else green
git branch -qv | grep "\*" | grep -q detached git branch -qv | grep "\*" | string match -rq detached
and set_color purple --bold and set_color brmagenta
or set_color green --bold or set_color brgreen
# Need optimization on this block (eliminate space) # Need optimization on this block (eliminate space)
git name-rev --name-only HEAD git name-rev --name-only HEAD
@ -32,9 +32,9 @@ function fish_right_prompt
(git status --porcelain | cut -c 1-2 | uniq) (git status --porcelain | cut -c 1-2 | uniq)
switch $i switch $i
case "*[ahead *" case "*[ahead *"
printf (set_color purple)' ' printf (set_color magenta)' '
case "*behind *" case "*behind *"
printf (set_color purple)' ' printf (set_color magenta)' '
case "." case "."
printf (set_color green)' ' printf (set_color green)' '
case " D" case " D"
@ -42,13 +42,12 @@ function fish_right_prompt
case "*M*" case "*M*"
printf (set_color blue)' ' printf (set_color blue)' '
case "*R*" case "*R*"
printf (set_color purple)' ' printf (set_color brmagenta)' '
case "*U*" case "*U*"
printf (set_color brown)' ' printf (set_color bryellow)' '
case "??" case "??"
printf (set_color white)' ' printf (set_color brwhite)' '
end end
end end
set_color normal
end end
end end