From 1c49965dcb0a9a347d298a4c427f822f23db1733 Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Thu, 3 Oct 2024 17:26:46 -0700 Subject: [PATCH 1/2] feat: Use two line fish prompt --- fish/functions/fish_prompt.fish | 37 ++++++++++++++++++--------- fish/functions/fish_right_prompt.fish | 8 ------ 2 files changed, 25 insertions(+), 20 deletions(-) delete mode 100755 fish/functions/fish_right_prompt.fish diff --git a/fish/functions/fish_prompt.fish b/fish/functions/fish_prompt.fish index 75b7a95..dbf199e 100755 --- a/fish/functions/fish_prompt.fish +++ b/fish/functions/fish_prompt.fish @@ -40,39 +40,52 @@ end function fish_prompt # set_color white -# echo -n '[' +# printf '[' set -l FishStatusCodeCache $status set_color -o 00FF00 - echo -n (whoami) + printf (whoami) set_color normal - echo -n '@' + printf '@' set_color AFD75F - echo -n (prompt_hostname) + printf (prompt_hostname) set_color white - echo -n ':' + printf ':' set_color 8787FF - echo -n (prompt_abbr $PWD) + printf (prompt_abbr $PWD) - set_color 5F87D7 - echo -n (__fish_vcs_prompt) + set -l vcs_prompt (fish_vcs_prompt) + if test -n "$vcs_prompt" + printf " " + set_color 5F87D7 + printf '\uf126' + printf (fish_vcs_prompt) + end if test $FishStatusCodeCache -eq 0 #set_color 18C412 else set_color E84505 - echo -n " [$FishStatusCodeCache]" + printf " [$FishStatusCodeCache]" end # set_color white -# echo -n "]" +# printf "]" - set_color -o white - echo -n "> " + set_color 999999 + printf " " + printf (date '+%Y/%m/%d %H:%M:%S') + printf "\n" + + #set_color -o white + #printf "> " + + set_color -o green + printf "⮀ " set_color normal end diff --git a/fish/functions/fish_right_prompt.fish b/fish/functions/fish_right_prompt.fish deleted file mode 100755 index 4fd2d57..0000000 --- a/fish/functions/fish_right_prompt.fish +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/fish - -function fish_right_prompt - set_color grey - printf (date '+%H:%M:%S') - set_color normal -end - From b9a1bf3dd359ed5e4fb683d57af4ffd135921e9d Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Thu, 3 Oct 2024 17:55:49 -0700 Subject: [PATCH 2/2] feat: Set bg color to differentiate prompt --- fish/functions/fish_prompt.fish | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fish/functions/fish_prompt.fish b/fish/functions/fish_prompt.fish index dbf199e..503f815 100755 --- a/fish/functions/fish_prompt.fish +++ b/fish/functions/fish_prompt.fish @@ -44,10 +44,11 @@ function fish_prompt set -l FishStatusCodeCache $status - set_color -o 00FF00 + set_color -o 00FF00 -b 333333 printf (whoami) set_color normal + set_color -b 333333 printf '@' set_color AFD75F @@ -85,6 +86,7 @@ function fish_prompt #set_color -o white #printf "> " + set_color normal set_color -o green printf "⮀ " set_color normal