From 75549ce64044336ed14e502f1c1ab8bf98184990 Mon Sep 17 00:00:00 2001 From: Zynh0722 Date: Sat, 16 Dec 2023 22:22:41 -0800 Subject: [PATCH] change main prompt icon --- fish_prompt.fish | 104 +++++++++++++++++++++++------------------------ 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index 8ab85a2..71a7788 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -11,85 +11,85 @@ set __slavic_color_purple 9458FF set __slavic_color_lilac AE81FF function __slavic_color_echo - set_color $argv[1] - if test (count $argv) -eq 2 - echo -n $argv[2] - end + set_color $argv[1] + if test (count $argv) -eq 2 + echo -n $argv[2] + end end function __slavic_current_folder - if test $PWD = '/' - echo -n '/' - else - echo -n $PWD | grep -o -E '[^\/]+$' - end + if test $PWD = / + echo -n / + else + echo -n $PWD | grep -o -E '[^\/]+$' + end end function __slavic_git_status_codes - echo (git status --porcelain 2>/dev/null | sed -E 's/(^.{3}).*/\1/' | tr -d ' \n') + echo (git status --porcelain 2>/dev/null | sed -E 's/(^.{3}).*/\1/' | tr -d ' \n') end function __slavic_git_branch_name - echo (git rev-parse --abbrev-ref HEAD 2>/dev/null) + echo (git rev-parse --abbrev-ref HEAD 2>/dev/null) end function __slavic_rainbow - if echo $argv[1] | grep -q -e $argv[3] - __slavic_color_echo $argv[2] "彡ミ" - end + if echo $argv[1] | grep -q -e $argv[3] + __slavic_color_echo $argv[2] 彡ミ + end end function __slavic_git_status_icons - set -l git_status (__slavic_git_status_codes) + set -l git_status (__slavic_git_status_codes) - __slavic_rainbow $git_status $__slavic_color_pink 'D' - __slavic_rainbow $git_status $__slavic_color_orange 'R' - __slavic_rainbow $git_status $__slavic_color_white 'C' - __slavic_rainbow $git_status $__slavic_color_green 'A' - __slavic_rainbow $git_status $__slavic_color_blue 'U' - __slavic_rainbow $git_status $__slavic_color_lilac 'M' - __slavic_rainbow $git_status $__slavic_color_grey '?' + __slavic_rainbow $git_status $__slavic_color_pink D + __slavic_rainbow $git_status $__slavic_color_orange R + __slavic_rainbow $git_status $__slavic_color_white C + __slavic_rainbow $git_status $__slavic_color_green A + __slavic_rainbow $git_status $__slavic_color_blue U + __slavic_rainbow $git_status $__slavic_color_lilac M + __slavic_rainbow $git_status $__slavic_color_grey '?' end function __slavic_git_status - # In git - if test -n (__slavic_git_branch_name) + # In git + if test -n (__slavic_git_branch_name) - __slavic_color_echo $__slavic_color_blue " ☭ " - __slavic_color_echo $__slavic_color_white (__slavic_git_branch_name) + __slavic_color_echo $__slavic_color_blue " ☭ " + __slavic_color_echo $__slavic_color_white (__slavic_git_branch_name) - if test -n (__slavic_git_status_codes) - __slavic_color_echo $__slavic_color_pink ' ●' - __slavic_color_echo $__slavic_color_white ' (^._.^)ノ' - __slavic_git_status_icons - else - __slavic_color_echo $__slavic_color_green ' ○' + if test -n (__slavic_git_status_codes) + __slavic_color_echo $__slavic_color_pink ' ●' + __slavic_color_echo $__slavic_color_white ' (^._.^)ノ' + __slavic_git_status_icons + else + __slavic_color_echo $__slavic_color_green ' ○' + end end - end end function fish_mode_prompt - set_color $__slavic_color_lilac - printf '[' - switch $fish_bind_mode - case default - set_color red - printf 'n' - case insert - set_color green - printf 'i' - case visual - set_color magenta - printf 'v' - end - set_color $__slavic_color_lilac - printf '] ' + set_color $__slavic_color_lilac + printf '[' + switch $fish_bind_mode + case default + set_color red + printf n + case insert + set_color green + printf i + case visual + set_color magenta + printf v + end + set_color $__slavic_color_lilac + printf '] ' end function fish_prompt - __slavic_color_echo $__slavic_color_purple (prompt_pwd) - __slavic_git_status + __slavic_color_echo $__slavic_color_purple (prompt_pwd) + __slavic_git_status - echo - __slavic_color_echo $__slavic_color_pink "⫸ " + echo + __slavic_color_echo $__slavic_color_pink "▶ " end