1
0
Fork 0

fish: some flair

This commit is contained in:
Von Random 2023-08-31 21:41:49 +03:00
parent 538490bf8b
commit ddada66167
4 changed files with 19 additions and 15 deletions

View file

@ -1,13 +1,10 @@
if ! string match -eq linux $TERM # some flair with randomized fish emoji: fish, tropical fish and blowfish
set prompt_bang \n\u266a\ set fishes \U1f41f \U1f420 \U1f421
set git_sign \ue0a0
else set git_sign \ue0a0
set prompt_bang \n\#\ set color_git_branch brblack
set git_sign g
end
# git symbols and colors # git symbols and colors
# [1] unstaged, [2] staged, [3] untracked, [4] conflicts # [1] unstaged, [2] staged, [3] untracked, [4] conflicts
set symbol_git \~ + ! \* set git_status \~ + ! \*
set color_git yellow blue red purple set color_git yellow blue red purple
set color_git_branch brblack

View file

@ -6,7 +6,7 @@ function fish_prompt
prompt.add (prompt_pwd) blue prompt.add (prompt_pwd) blue
prompt.git prompt.git
prompt.add \] brblack prompt.add \] brblack
prompt.add $prompt_bang brred prompt.bang
echo $prompt_string echo $prompt_string
set -e prompt_string set -e prompt_string

View file

@ -0,0 +1,7 @@
function prompt.bang
if ! string match -eq linux $TERM
prompt.add \n$fishes[(random 1 3)]\
else
prompt.add \n\#\ brred
end
end

View file

@ -14,8 +14,8 @@ function prompt.git
string match -qr "^[ADU]{2}" "$line" && set git_count[4] (math $git_count[4] + 1) string match -qr "^[ADU]{2}" "$line" && set git_count[4] (math $git_count[4] + 1)
end end
end end
test -n "$git_count[1]" && prompt.add "$git_count[1]$symbol_git[1]" "$color_git[1]" test -n "$git_count[1]" && prompt.add "$git_count[1]$git_status[1]" "$color_git[1]"
test -n "$git_count[2]" && prompt.add "$git_count[2]$symbol_git[2]" "$color_git[2]" test -n "$git_count[2]" && prompt.add "$git_count[2]$git_status[2]" "$color_git[2]"
test -n "$git_count[3]" && prompt.add "$git_count[3]$symbol_git[3]" "$color_git[3]" test -n "$git_count[3]" && prompt.add "$git_count[3]$git_status[3]" "$color_git[3]"
test -n "$git_count[4]" && prompt.add "$git_count[4]$symbol_git[4]" "$color_git[4]" test -n "$git_count[4]" && prompt.add "$git_count[4]$git_status[4]" "$color_git[4]"
end end