mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 20:33:08 +00:00
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:
parent
9701d5cc7b
commit
c18614552d
1 changed files with 10 additions and 11 deletions
|
@ -2,7 +2,7 @@
|
|||
# author: Ivan Tham <ivanthamjunhoe@gmail.com>
|
||||
|
||||
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)"#"
|
||||
|
||||
|
@ -15,10 +15,10 @@ function fish_right_prompt
|
|||
test $status != 0; and printf (set_color red)"⏎ "
|
||||
|
||||
if git rev-parse ^ /dev/null
|
||||
# Purple if branch detached else green
|
||||
git branch -qv | grep "\*" | grep -q detached
|
||||
and set_color purple --bold
|
||||
or set_color green --bold
|
||||
# Magenta if branch detached else green
|
||||
git branch -qv | grep "\*" | string match -rq detached
|
||||
and set_color brmagenta
|
||||
or set_color brgreen
|
||||
|
||||
# Need optimization on this block (eliminate space)
|
||||
git name-rev --name-only HEAD
|
||||
|
@ -32,9 +32,9 @@ function fish_right_prompt
|
|||
(git status --porcelain | cut -c 1-2 | uniq)
|
||||
switch $i
|
||||
case "*[ahead *"
|
||||
printf (set_color purple)⬆' '
|
||||
printf (set_color magenta)⬆' '
|
||||
case "*behind *"
|
||||
printf (set_color purple)⬇' '
|
||||
printf (set_color magenta)⬇' '
|
||||
case "."
|
||||
printf (set_color green)✚' '
|
||||
case " D"
|
||||
|
@ -42,13 +42,12 @@ function fish_right_prompt
|
|||
case "*M*"
|
||||
printf (set_color blue)✱' '
|
||||
case "*R*"
|
||||
printf (set_color purple)➜' '
|
||||
printf (set_color brmagenta)➜' '
|
||||
case "*U*"
|
||||
printf (set_color brown)═' '
|
||||
printf (set_color bryellow)═' '
|
||||
case "??"
|
||||
printf (set_color white)◼' '
|
||||
printf (set_color brwhite)◼' '
|
||||
end
|
||||
end
|
||||
set_color normal
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue