From ba53918dc22cb1c0db6104c3250f929798a69e0a Mon Sep 17 00:00:00 2001 From: Florian Meinicke Date: Sat, 3 Oct 2020 09:55:08 +0200 Subject: [PATCH 01/18] Fix nord colorscheme for exit, su, jobs segments --- functions/__bobthefish_colors.fish | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/functions/__bobthefish_colors.fish b/functions/__bobthefish_colors.fish index 1ead6e2..f038988 100644 --- a/functions/__bobthefish_colors.fish +++ b/functions/__bobthefish_colors.fish @@ -524,10 +524,10 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -l colorfg $base00 - set -x color_initial_segment_exit $base05 $base08 --bold + set -x color_initial_segment_exit $base05 $base0B --bold set -x color_initial_segment_private $base05 $base02 - set -x color_initial_segment_su $base05 $base0B --bold - set -x color_initial_segment_jobs $base08 $base0D --bold + set -x color_initial_segment_su $base05 $base0E --bold + set -x color_initial_segment_jobs $base05 $base0C --bold set -x color_path $base02 $base05 set -x color_path_basename $base02 $base06 --bold From 140441fe3661d8746b3f80f2038ee1d0a74ebd9f Mon Sep 17 00:00:00 2001 From: Florian Meinicke Date: Thu, 15 Oct 2020 08:54:28 +0200 Subject: [PATCH 02/18] Remove trailing whitespaces --- functions/__bobthefish_colors.fish | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/functions/__bobthefish_colors.fish b/functions/__bobthefish_colors.fish index f038988..4ef5f41 100644 --- a/functions/__bobthefish_colors.fish +++ b/functions/__bobthefish_colors.fish @@ -524,10 +524,10 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -l colorfg $base00 - set -x color_initial_segment_exit $base05 $base0B --bold + set -x color_initial_segment_exit $base05 $base0B --bold set -x color_initial_segment_private $base05 $base02 - set -x color_initial_segment_su $base05 $base0E --bold - set -x color_initial_segment_jobs $base05 $base0C --bold + set -x color_initial_segment_su $base05 $base0E --bold + set -x color_initial_segment_jobs $base05 $base0C --bold set -x color_path $base02 $base05 set -x color_path_basename $base02 $base06 --bold From bc94c77cbdcf913698a2bf056ab60da274fa0653 Mon Sep 17 00:00:00 2001 From: Darren Kidd Date: Tue, 8 Sep 2020 15:06:39 +1200 Subject: [PATCH 03/18] Create new segment for AWS Vault profile * Tracks the session expiration information and adds this to the segment as well (if available - which it should be). * Using basic blue/white colours at the moment. * Added doco including link to AWS Vault repo. --- README.md | 1 + fish_prompt.fish | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/README.md b/README.md index 381fb89..a99cfb6 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,7 @@ set -g theme_newline_prompt '$ ' - `theme_display_vi`. By default the vi mode indicator will be shown if vi or hybrid key bindings are enabled. Use `no` to hide the indicator, or `yes` to show the indicator. - `theme_display_k8s_context`. This feature is disabled by default. Use `yes` to show the current kubernetes context (`> kubectl config current-context`). - `theme_display_k8s_namespace`. This feature is disabled by default. Use `yes` to show the current kubernetes namespace. +- `theme_display_aws_vault_profile`. This feature is disabled by default. Use `yes` to show the currently executing [AWS Vault](https://github.com/99designs/aws-vault) profile. - `theme_display_user`. If set to `yes`, display username always, if set to `ssh`, only when an SSH-Session is detected, if set to no, never. - `theme_display_hostname`. Same behaviour as `theme_display_user`. - `theme_display_sudo_user`. If set to `yes`, displays the sudo-username in a root shell. For example, when calling `sudo -s` and having this option set to `yes`, the username of the user, who called `sudo -s`, will be displayed. diff --git a/fish_prompt.fish b/fish_prompt.fish index 6121652..318e9d0 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -29,6 +29,7 @@ # set -g theme_display_docker_machine no # set -g theme_display_k8s_context yes # set -g theme_display_k8s_namespace no +# set -g theme_display_aws_vault_profile yes # set -g theme_display_hg yes # set -g theme_display_virtualenv no # set -g theme_display_nix no @@ -644,6 +645,32 @@ function __bobthefish_prompt_k8s_context -S -d 'Show current Kubernetes context' end +# ============================== +# Cloud Tools +# ============================== + +function __bobthefish_prompt_aws_vault_profile -S -d 'Show AWS Vault profile' + [ "$theme_display_aws_vault_profile" = 'yes' ] + or return + + [ -n "$AWS_VAULT" -a -n "$AWS_SESSION_EXPIRATION" ] + or return + + set -l profile $AWS_VAULT + + set -l now (date --utc +%s) + set -l expiry (date -d "$AWS_SESSION_EXPIRATION" +%s) + set -l diff_mins (math "floor(( $expiry - $now ) / 60)") + [ "$diff_mins" -lt 0 ] + and set -l diff_mins 0 + + set -l segment $profile " (" $diff_mins "m)" + + __bobthefish_start_segment blue white --bold + echo -ns $segment " " +end + + # ============================== # User / hostname info segments # ============================== @@ -1076,6 +1103,9 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' __bobthefish_prompt_docker __bobthefish_prompt_k8s_context + # Cloud Tools + __bobthefish_prompt_aws_vault_profile + # Virtual environments __bobthefish_prompt_nix __bobthefish_prompt_desk From cb821bb737895ca3b19d5c61ce380ed2dc400e0f Mon Sep 17 00:00:00 2001 From: Darren Kidd Date: Tue, 8 Sep 2020 15:30:18 +1200 Subject: [PATCH 04/18] Added in custom colours * Also added in a placeholder to bobthefish_display_colors() so I can check theming easily. --- fish_prompt.fish | 2 +- functions/__bobthefish_colors.fish | 14 ++++++++++++++ functions/bobthefish_display_colors.fish | 4 ++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index 318e9d0..3dcdfb8 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -666,7 +666,7 @@ function __bobthefish_prompt_aws_vault_profile -S -d 'Show AWS Vault profile' set -l segment $profile " (" $diff_mins "m)" - __bobthefish_start_segment blue white --bold + __bobthefish_start_segment $color_aws_vault echo -ns $segment " " end diff --git a/functions/__bobthefish_colors.fish b/functions/__bobthefish_colors.fish index 4ef5f41..e430d3c 100644 --- a/functions/__bobthefish_colors.fish +++ b/functions/__bobthefish_colors.fish @@ -28,6 +28,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant brcyan $colorfg set -x color_k8s magenta white --bold + set -x color_aws_vault blue $colorfg --bold set -x color_username white black --bold set -x color_hostname white black set -x color_rvm brmagenta $colorfg --bold @@ -61,6 +62,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant brcyan $colorfg set -x color_k8s magenta white --bold + set -x color_aws_vault blue $colorfg --bold set -x color_username black white --bold set -x color_hostname black white set -x color_rvm brmagenta $colorfg --bold @@ -94,6 +96,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant brcyan $colorfg set -x color_k8s magenta white --bold + set -x color_aws_vault blue $colorfg --bold set -x color_username brgrey white --bold set -x color_hostname brgrey white set -x color_rvm brmagenta $colorfg --bold @@ -127,6 +130,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant brcyan $colorfg set -x color_k8s magenta white --bold + set -x color_aws_vault blue $colorfg --bold set -x color_username grey black --bold set -x color_hostname grey black set -x color_rvm brmagenta $colorfg --bold @@ -166,6 +170,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $blue $green --bold set -x color_k8s $green $white --bold + set -x color_aws_vault $blue $grey --bold set -x color_username $grey $blue --bold set -x color_hostname $grey $blue set -x color_rvm $red $grey --bold @@ -216,6 +221,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $base0C $colorfg --bold set -x color_k8s $base06 $colorfg --bold + set -x color_aws_vault $base0D $colorfg --bold set -x color_username $base02 $base0D --bold set -x color_hostname $base02 $base0D set -x color_rvm $base08 $colorfg --bold @@ -266,6 +272,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $base0C $colorfg --bold set -x color_k8s $base0B $colorfg --bold + set -x color_aws_vault $base0D $base0A --bold set -x color_username $base02 $base0D --bold set -x color_hostname $base02 $base0D set -x color_rvm $base08 $colorfg --bold @@ -316,6 +323,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $violet $colorfg --bold set -x color_k8s $green $colorfg --bold + set -x color_aws_vault $violet $base3 --bold set -x color_username $base2 $blue --bold set -x color_hostname $base2 $blue set -x color_rvm $red $colorfg --bold @@ -366,6 +374,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $violet $colorfg --bold set -x color_k8s $green $colorfg --bold + set -x color_aws_vault $violet $base3 --bold set -x color_username $base02 $blue --bold set -x color_hostname $base02 $blue set -x color_rvm $red $colorfg --bold @@ -409,6 +418,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $blue[1] $white --bold set -x color_k8s $green[1] $colorfg --bold + set -x color_aws_vault $blue[3] $orange[1] --bold set -x color_username $grey[1] $blue[3] --bold set -x color_hostname $grey[1] $blue[3] set -x color_rvm $ruby_red $grey[1] --bold @@ -451,6 +461,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $blue[2] $fg[2] --bold set -x color_k8s $green[2] $fg[2] --bold + set -x color_aws_vault $blue[2] $yellow[1] --bold set -x color_username $fg[3] $blue[2] --bold set -x color_hostname $fg[3] $blue[2] set -x color_rvm $red[2] $fg[2] --bold @@ -495,6 +506,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $pink $bg --bold set -x color_k8s $green $fg --bold + set -x color_aws_vault $comment $yellow --bold set -x color_username $selection $cyan --bold set -x color_hostname $selection $cyan set -x color_rvm $red $bg --bold @@ -545,6 +557,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $base02 $colorfg --bold set -x color_k8s $base02 $colorfg --bold + set -x color_aws_vault $base0A $base0D --bold set -x color_username $base02 $base0D --bold set -x color_hostname $base02 $base0D set -x color_rvm $base09 $colorfg --bold @@ -588,6 +601,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $blue[1] $white --bold set -x color_k8s $green[2] $white --bold + set -x color_aws_vault $blue[3] $orange[1] --bold set -x color_username $grey[1] $blue[3] --bold set -x color_hostname $grey[1] $blue[3] set -x color_rvm $ruby_red $grey[1] --bold diff --git a/functions/bobthefish_display_colors.fish b/functions/bobthefish_display_colors.fish index 836de13..774aca1 100644 --- a/functions/bobthefish_display_colors.fish +++ b/functions/bobthefish_display_colors.fish @@ -141,5 +141,9 @@ function bobthefish_display_colors -a color_scheme -d 'Print example prompt colo echo -ns $desk_glyph desk ' ' __bobthefish_finish_segments + __bobthefish_start_segment $color_aws_vault + echo -ns $aws_vault_glyph ' aws-vault ' + __bobthefish_finish_segments + echo -e "\n" end From dfec8fa044a937b7a84f54dc2d7cf39495770580 Mon Sep 17 00:00:00 2001 From: Darren Kidd Date: Fri, 11 Sep 2020 07:19:32 +1200 Subject: [PATCH 05/18] Remove unused glyph --- functions/bobthefish_display_colors.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/bobthefish_display_colors.fish b/functions/bobthefish_display_colors.fish index 774aca1..86b6caf 100644 --- a/functions/bobthefish_display_colors.fish +++ b/functions/bobthefish_display_colors.fish @@ -142,7 +142,7 @@ function bobthefish_display_colors -a color_scheme -d 'Print example prompt colo __bobthefish_finish_segments __bobthefish_start_segment $color_aws_vault - echo -ns $aws_vault_glyph ' aws-vault ' + echo -ns aws-vault ' ' __bobthefish_finish_segments echo -e "\n" From 5f7292092e1da50246487faaa451acef8b49b10c Mon Sep 17 00:00:00 2001 From: Darren Kidd Date: Wed, 9 Sep 2020 15:57:13 +1200 Subject: [PATCH 06/18] Anything greater than an hour now in XhYm format --- fish_prompt.fish | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index 3dcdfb8..028185a 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -661,10 +661,14 @@ function __bobthefish_prompt_aws_vault_profile -S -d 'Show AWS Vault profile' set -l now (date --utc +%s) set -l expiry (date -d "$AWS_SESSION_EXPIRATION" +%s) set -l diff_mins (math "floor(( $expiry - $now ) / 60)") - [ "$diff_mins" -lt 0 ] - and set -l diff_mins 0 - set -l segment $profile " (" $diff_mins "m)" + set -l diff_time $diff_mins"m" + [ $diff_mins -le 0 ] + and set -l diff_time "0m" + [ $diff_mins -ge 60 ] + and set -l diff_time (math "floor($diff_mins / 60)")"h"(math "$diff_mins % 60")"m" + + set -l segment $profile " (" $diff_time ")" __bobthefish_start_segment $color_aws_vault echo -ns $segment " " From 9ea42689a2eb21cb20245161af0c0ae1805a63f0 Mon Sep 17 00:00:00 2001 From: Darren Kidd Date: Wed, 9 Sep 2020 16:18:53 +1200 Subject: [PATCH 07/18] Change text colour when the session has expired --- fish_prompt.fish | 5 ++++- functions/__bobthefish_colors.fish | 14 ++++++++++++++ functions/bobthefish_display_colors.fish | 6 +++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index 028185a..dcf6508 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -669,8 +669,11 @@ function __bobthefish_prompt_aws_vault_profile -S -d 'Show AWS Vault profile' and set -l diff_time (math "floor($diff_mins / 60)")"h"(math "$diff_mins % 60")"m" set -l segment $profile " (" $diff_time ")" + set -l status_color $color_aws_vault + [ $diff_mins -le 0 ] + and set -l status_color $color_aws_vault_expired - __bobthefish_start_segment $color_aws_vault + __bobthefish_start_segment $status_color echo -ns $segment " " end diff --git a/functions/__bobthefish_colors.fish b/functions/__bobthefish_colors.fish index e430d3c..9df01a7 100644 --- a/functions/__bobthefish_colors.fish +++ b/functions/__bobthefish_colors.fish @@ -29,6 +29,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant brcyan $colorfg set -x color_k8s magenta white --bold set -x color_aws_vault blue $colorfg --bold + set -x color_aws_vault_expired blue red --bold set -x color_username white black --bold set -x color_hostname white black set -x color_rvm brmagenta $colorfg --bold @@ -63,6 +64,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant brcyan $colorfg set -x color_k8s magenta white --bold set -x color_aws_vault blue $colorfg --bold + set -x color_aws_vault_expired blue red --bold set -x color_username black white --bold set -x color_hostname black white set -x color_rvm brmagenta $colorfg --bold @@ -97,6 +99,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant brcyan $colorfg set -x color_k8s magenta white --bold set -x color_aws_vault blue $colorfg --bold + set -x color_aws_vault_expired blue red --bold set -x color_username brgrey white --bold set -x color_hostname brgrey white set -x color_rvm brmagenta $colorfg --bold @@ -131,6 +134,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant brcyan $colorfg set -x color_k8s magenta white --bold set -x color_aws_vault blue $colorfg --bold + set -x color_aws_vault_expired blue red --bold set -x color_username grey black --bold set -x color_hostname grey black set -x color_rvm brmagenta $colorfg --bold @@ -171,6 +175,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $blue $green --bold set -x color_k8s $green $white --bold set -x color_aws_vault $blue $grey --bold + set -x color_aws_vault_expired $blue $red --bold set -x color_username $grey $blue --bold set -x color_hostname $grey $blue set -x color_rvm $red $grey --bold @@ -222,6 +227,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $base0C $colorfg --bold set -x color_k8s $base06 $colorfg --bold set -x color_aws_vault $base0D $colorfg --bold + set -x color_aws_vault_expired $base0D $base08 --bold set -x color_username $base02 $base0D --bold set -x color_hostname $base02 $base0D set -x color_rvm $base08 $colorfg --bold @@ -273,6 +279,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $base0C $colorfg --bold set -x color_k8s $base0B $colorfg --bold set -x color_aws_vault $base0D $base0A --bold + set -x color_aws_vault_expired $base0D $base08 --bold set -x color_username $base02 $base0D --bold set -x color_hostname $base02 $base0D set -x color_rvm $base08 $colorfg --bold @@ -324,6 +331,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $violet $colorfg --bold set -x color_k8s $green $colorfg --bold set -x color_aws_vault $violet $base3 --bold + set -x color_aws_vault_expired $violet $orange --bold set -x color_username $base2 $blue --bold set -x color_hostname $base2 $blue set -x color_rvm $red $colorfg --bold @@ -375,6 +383,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $violet $colorfg --bold set -x color_k8s $green $colorfg --bold set -x color_aws_vault $violet $base3 --bold + set -x color_aws_vault_expired $violet $orange --bold set -x color_username $base02 $blue --bold set -x color_hostname $base02 $blue set -x color_rvm $red $colorfg --bold @@ -419,6 +428,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $blue[1] $white --bold set -x color_k8s $green[1] $colorfg --bold set -x color_aws_vault $blue[3] $orange[1] --bold + set -x color_aws_vault_expired $blue[3] $red[3] --bold set -x color_username $grey[1] $blue[3] --bold set -x color_hostname $grey[1] $blue[3] set -x color_rvm $ruby_red $grey[1] --bold @@ -462,6 +472,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $blue[2] $fg[2] --bold set -x color_k8s $green[2] $fg[2] --bold set -x color_aws_vault $blue[2] $yellow[1] --bold + set -x color_aws_vault_expired $blue[2] $red[1] --bold set -x color_username $fg[3] $blue[2] --bold set -x color_hostname $fg[3] $blue[2] set -x color_rvm $red[2] $fg[2] --bold @@ -507,6 +518,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $pink $bg --bold set -x color_k8s $green $fg --bold set -x color_aws_vault $comment $yellow --bold + set -x color_aws_vault_expired $comment $red --bold set -x color_username $selection $cyan --bold set -x color_hostname $selection $cyan set -x color_rvm $red $bg --bold @@ -558,6 +570,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $base02 $colorfg --bold set -x color_k8s $base02 $colorfg --bold set -x color_aws_vault $base0A $base0D --bold + set -x color_aws_vault_expired $base0A $base0B --bold set -x color_username $base02 $base0D --bold set -x color_hostname $base02 $base0D set -x color_rvm $base09 $colorfg --bold @@ -602,6 +615,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_vagrant $blue[1] $white --bold set -x color_k8s $green[2] $white --bold set -x color_aws_vault $blue[3] $orange[1] --bold + set -x color_aws_vault_expired $blue[3] $red[3] --bold set -x color_username $grey[1] $blue[3] --bold set -x color_hostname $grey[1] $blue[3] set -x color_rvm $ruby_red $grey[1] --bold diff --git a/functions/bobthefish_display_colors.fish b/functions/bobthefish_display_colors.fish index 86b6caf..79a2804 100644 --- a/functions/bobthefish_display_colors.fish +++ b/functions/bobthefish_display_colors.fish @@ -142,7 +142,11 @@ function bobthefish_display_colors -a color_scheme -d 'Print example prompt colo __bobthefish_finish_segments __bobthefish_start_segment $color_aws_vault - echo -ns aws-vault ' ' + echo -ns aws-vault active ' ' + __bobthefish_finish_segments + + __bobthefish_start_segment $color_aws_vault_expired + echo -ns aws-vault expired ' ' __bobthefish_finish_segments echo -e "\n" From b5d7614aa0a94c1036f3db52f0011b90437bf382 Mon Sep 17 00:00:00 2001 From: Darren Kidd Date: Wed, 9 Sep 2020 16:22:31 +1200 Subject: [PATCH 08/18] Update colors documentation - missed this last time --- functions/__bobthefish_colors.fish | 2 ++ 1 file changed, 2 insertions(+) diff --git a/functions/__bobthefish_colors.fish b/functions/__bobthefish_colors.fish index 9df01a7..162959b 100644 --- a/functions/__bobthefish_colors.fish +++ b/functions/__bobthefish_colors.fish @@ -682,6 +682,8 @@ function __bobthefish_user_color_scheme_deprecated set -x color_vi_mode_insert $__color_vi_mode_insert set -x color_vi_mode_visual $__color_vi_mode_visual set -x color_vagrant $__color_vagrant + set -x color_aws_vault $__color_aws_vault + set -x color_aws_vault_expired $__color_aws_vault_expired set -x color_username $__color_username set -x color_hostname $__color_hostname set -x color_rvm $__color_rvm From 64366ed6580a700548352c8b81831ffd58a79da8 Mon Sep 17 00:00:00 2001 From: Darren Kidd Date: Mon, 19 Oct 2020 09:51:44 +1300 Subject: [PATCH 09/18] Fix spacing in AWS vault test segments --- functions/bobthefish_display_colors.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/bobthefish_display_colors.fish b/functions/bobthefish_display_colors.fish index 79a2804..e1dfc62 100644 --- a/functions/bobthefish_display_colors.fish +++ b/functions/bobthefish_display_colors.fish @@ -142,11 +142,11 @@ function bobthefish_display_colors -a color_scheme -d 'Print example prompt colo __bobthefish_finish_segments __bobthefish_start_segment $color_aws_vault - echo -ns aws-vault active ' ' + echo -ns aws-vault ' (' active ') ' __bobthefish_finish_segments __bobthefish_start_segment $color_aws_vault_expired - echo -ns aws-vault expired ' ' + echo -ns aws-vault ' (' expired ') ' __bobthefish_finish_segments echo -e "\n" From 57d172882f61a4d896ed584cc7e7bf1bd13a08ea Mon Sep 17 00:00:00 2001 From: Darren Kidd Date: Thu, 22 Oct 2020 04:54:03 +1300 Subject: [PATCH 10/18] Support for Git default branches other than master (#276) * Make main behave like master branch * Check list of default git branches * Use new theme var with better name * Update documentation around git default branch names --- README.md | 7 ++++++- fish_prompt.fish | 17 +++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a99cfb6..8b8ad44 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,8 @@ set -g theme_display_git_untracked no set -g theme_display_git_ahead_verbose yes set -g theme_display_git_dirty_verbose yes set -g theme_display_git_stashed_verbose yes -set -g theme_display_git_master_branch yes +set -g theme_display_git_default_branch yes +set -g theme_git_default_branches master main set -g theme_git_worktree_support yes set -g theme_use_abbreviated_branch_name yes set -g theme_display_vagrant yes @@ -108,6 +109,10 @@ set -g theme_project_dir_length 1 set -g theme_newline_cursor yes set -g theme_newline_prompt '$ ' ``` +**Git options** + +- `theme_display_git_default_branch`. By default theme will hide/collapse the branch name in your prompt when you are using a Git _default branch_ i.e. historically `master` and often `main` now. Set to `yes` to stop these branches from being hidden/collapsed. +- `theme_git_default_branches`. The big cloud repos (GitHub, Bitbucket, GitLab et al.) are moving away from using `master` as the default branch name, and allow you to choose your own. As of version **2.28**, Git also supports custom default branch names via the `init.defaultBranch` config option. If our defaults of `master main` don't suit you, you can add/remove names in thist list i.e. `main trunk`. This ensures correct hiding/collapsing behaviour with custom default branch names (unless option above is activated). **Title options** diff --git a/fish_prompt.fish b/fish_prompt.fish index dcf6508..3016922 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -23,7 +23,8 @@ # set -g theme_display_git_ahead_verbose yes # set -g theme_display_git_dirty_verbose yes # set -g theme_display_git_stashed_verbose yes -# set -g theme_display_git_master_branch yes +# set -g theme_display_git_default_branch yes +# set -g theme_git_default_branches main trunk # set -g theme_git_worktree_support yes # set -g theme_display_vagrant yes # set -g theme_display_docker_machine no @@ -77,18 +78,22 @@ function __bobthefish_escape_regex -a str -d 'A backwards-compatible `string esc end function __bobthefish_git_branch -S -d 'Get the current git branch (or commitish)' - set -l ref (command git symbolic-ref HEAD 2>/dev/null) + set -l branch (command git symbolic-ref HEAD | string replace -r '^refs/heads/' '' 2>/dev/null) and begin - [ "$theme_display_git_master_branch" != 'yes' -a "$ref" = 'refs/heads/master' ] + [ -n "$theme_git_default_branches" ] + or set -l theme_git_default_branches master main + + [ "$theme_display_git_master_branch" != 'yes' -a "$theme_display_git_default_branch" != 'yes' ] + and contains $branch $theme_git_default_branches and echo $branch_glyph and return # truncate the middle of the branch name, but only if it's 25+ characters - set -l truncname $ref + set -l truncname $branch [ "$theme_use_abbreviated_branch_name" = 'yes' ] - and set truncname (string replace -r '^(.{28}).{3,}(.{5})$' "\$1…\$2" $ref) + and set truncname (string replace -r '^(.{17}).{3,}(.{5})$' "\$1…\$2" $branch) - string replace -r '^refs/heads/' "$branch_glyph " $truncname + echo $branch_glyph $truncname and return end From 35c0a1b9b075d1248edab5870cea6426a9bcc8d3 Mon Sep 17 00:00:00 2001 From: WiredSharp Date: Sat, 12 Sep 2020 14:24:40 +0200 Subject: [PATCH 11/18] use system timezone as default --- fish_right_prompt.fish | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fish_right_prompt.fish b/fish_right_prompt.fish index bd6ee94..ef54772 100644 --- a/fish_right_prompt.fish +++ b/fish_right_prompt.fish @@ -63,7 +63,9 @@ function __bobthefish_timestamp -S -d 'Show the current timestamp' or set -l theme_date_format "+%c" echo -n ' ' - env TZ="$theme_date_timezone" date $theme_date_format + set -q theme_date_timezone + and env TZ="$theme_date_timezone" date $theme_date_format + or date $theme_date_format end function fish_right_prompt -d 'bobthefish is all about the right prompt' From 12b829e0bfa0b57a155058cdb59e203f9c1f5db4 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Tue, 1 Dec 2020 22:49:10 -0800 Subject: [PATCH 12/18] Fix "HEAD is not a symbolic ref" error when HEAD is a tag. --- fish_prompt.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index 3016922..e0a653e 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -78,7 +78,7 @@ function __bobthefish_escape_regex -a str -d 'A backwards-compatible `string esc end function __bobthefish_git_branch -S -d 'Get the current git branch (or commitish)' - set -l branch (command git symbolic-ref HEAD | string replace -r '^refs/heads/' '' 2>/dev/null) + set -l branch (command git symbolic-ref HEAD 2>/dev/null | string replace -r '^refs/heads/' '') and begin [ -n "$theme_git_default_branches" ] or set -l theme_git_default_branches master main From 954fbc961b779c29ad24749f9a09095d049fb752 Mon Sep 17 00:00:00 2001 From: Nathan Gilbert <546222+nathan-gilbert@users.noreply.github.com> Date: Sat, 23 Jan 2021 11:47:21 -0700 Subject: [PATCH 13/18] move files to support fisher plugin standards (#293) --- fish_greeting.fish => functions/fish_greeting.fish | 0 fish_mode_prompt.fish => functions/fish_mode_prompt.fish | 0 fish_prompt.fish => functions/fish_prompt.fish | 0 fish_right_prompt.fish => functions/fish_right_prompt.fish | 0 fish_title.fish => functions/fish_title.fish | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename fish_greeting.fish => functions/fish_greeting.fish (100%) rename fish_mode_prompt.fish => functions/fish_mode_prompt.fish (100%) rename fish_prompt.fish => functions/fish_prompt.fish (100%) rename fish_right_prompt.fish => functions/fish_right_prompt.fish (100%) rename fish_title.fish => functions/fish_title.fish (100%) diff --git a/fish_greeting.fish b/functions/fish_greeting.fish similarity index 100% rename from fish_greeting.fish rename to functions/fish_greeting.fish diff --git a/fish_mode_prompt.fish b/functions/fish_mode_prompt.fish similarity index 100% rename from fish_mode_prompt.fish rename to functions/fish_mode_prompt.fish diff --git a/fish_prompt.fish b/functions/fish_prompt.fish similarity index 100% rename from fish_prompt.fish rename to functions/fish_prompt.fish diff --git a/fish_right_prompt.fish b/functions/fish_right_prompt.fish similarity index 100% rename from fish_right_prompt.fish rename to functions/fish_right_prompt.fish diff --git a/fish_title.fish b/functions/fish_title.fish similarity index 100% rename from fish_title.fish rename to functions/fish_title.fish From af5aac28c4ee68cddd60aff47d1afb6d1f7c898f Mon Sep 17 00:00:00 2001 From: Wes Baker Date: Sun, 24 Jan 2021 17:14:30 -0500 Subject: [PATCH 14/18] Add FNM as an alternative to NVM (#292) * Add FNM as an alternative to NVM * Made the __bobthefish_prompt_nvm generic for nvm and fnm * Hide errors on node_manager current * Check for color_nvm and set color_node based on that --- README.md | 6 +++--- functions/__bobthefish_colors.fish | 28 ++++++++++++++-------------- functions/fish_prompt.fish | 29 +++++++++++++++++++++++------ 3 files changed, 40 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 8b8ad44..8aa4f2b 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ This theme is based loosely on [agnoster][agnoster]. * Current RVM, rbenv or chruby (Ruby) version * Current virtualenv (Python) version * _If you use virtualenv, you will probably need to disable the default virtualenv prompt, since it doesn't play nice with fish: `set -x VIRTUAL_ENV_DISABLE_PROMPT 1`_ - * Current NVM version (Nodejs) (inactive by default; see configurations in the next paragraph) + * Current NVM/FNM version (Nodejs) (inactive by default; see configurations in the next paragraph) * Abbreviated parent directory * Current directory, or Git or Mercurial project name * Current project's repo branch (branch-glyph master) or detached head (`➦` d0dfd9b) @@ -85,7 +85,7 @@ set -g theme_display_hg yes set -g theme_display_virtualenv no set -g theme_display_nix no set -g theme_display_ruby no -set -g theme_display_nvm yes +set -g theme_display_node yes set -g theme_display_user ssh set -g theme_display_hostname ssh set -g theme_display_vi no @@ -124,7 +124,7 @@ set -g theme_newline_prompt '$ ' **Prompt options** - `theme_display_ruby`. Use `no` to completely hide all information about Ruby version. By default Ruby version displayed if there is the difference from default settings. -- `theme_display_nvm`. If set to `yes`, will display current NVM node version. +- `theme_display_node`. If set to `yes`, will display current NVM or FNM node version. - `theme_display_vagrant`. This feature is disabled by default, use `yes` to display Vagrant status in your prompt. Please note that only the VirtualBox and VMWare providers are supported. - `theme_display_vi`. By default the vi mode indicator will be shown if vi or hybrid key bindings are enabled. Use `no` to hide the indicator, or `yes` to show the indicator. - `theme_display_k8s_context`. This feature is disabled by default. Use `yes` to show the current kubernetes context (`> kubectl config current-context`). diff --git a/functions/__bobthefish_colors.fish b/functions/__bobthefish_colors.fish index 162959b..1ee71d2 100644 --- a/functions/__bobthefish_colors.fish +++ b/functions/__bobthefish_colors.fish @@ -33,7 +33,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_username white black --bold set -x color_hostname white black set -x color_rvm brmagenta $colorfg --bold - set -x color_nvm brgreen $colorfg --bold + set -x color_node brgreen $colorfg --bold set -x color_virtualfish brblue $colorfg --bold set -x color_virtualgo brblue $colorfg --bold set -x color_desk brblue $colorfg --bold @@ -68,7 +68,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_username black white --bold set -x color_hostname black white set -x color_rvm brmagenta $colorfg --bold - set -x color_nvm brgreen $colorfg --bold + set -x color_node brgreen $colorfg --bold set -x color_virtualfish brblue $colorfg --bold set -x color_virtualgo brblue $colorfg --bold set -x color_desk brblue $colorfg --bold @@ -103,7 +103,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_username brgrey white --bold set -x color_hostname brgrey white set -x color_rvm brmagenta $colorfg --bold - set -x color_nvm brgreen $colorfg --bold + set -x color_node brgreen $colorfg --bold set -x color_virtualfish brblue $colorfg --bold set -x color_virtualgo brblue $colorfg --bold set -x color_desk brblue $colorfg --bold @@ -138,7 +138,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_username grey black --bold set -x color_hostname grey black set -x color_rvm brmagenta $colorfg --bold - set -x color_nvm brgreen $colorfg --bold + set -x color_node brgreen $colorfg --bold set -x color_virtualfish brblue $colorfg --bold set -x color_virtualgo brblue $colorfg --bold set -x color_desk brblue $colorfg --bold @@ -179,7 +179,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_username $grey $blue --bold set -x color_hostname $grey $blue set -x color_rvm $red $grey --bold - set -x color_nvm $green $white --bold + set -x color_node $green $white --bold set -x color_virtualfish $blue $grey --bold set -x color_virtualgo $blue $grey --bold set -x color_desk $blue $grey --bold @@ -231,7 +231,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_username $base02 $base0D --bold set -x color_hostname $base02 $base0D set -x color_rvm $base08 $colorfg --bold - set -x color_nvm $base0B $colorfg --bold + set -x color_node $base0B $colorfg --bold set -x color_virtualfish $base0D $colorfg --bold set -x color_virtualgo $base0D $colorfg --bold set -x color_desk $base0D $colorfg --bold @@ -283,7 +283,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_username $base02 $base0D --bold set -x color_hostname $base02 $base0D set -x color_rvm $base08 $colorfg --bold - set -x color_nvm $base0B $colorfg --bold + set -x color_node $base0B $colorfg --bold set -x color_virtualfish $base0D $colorfg --bold set -x color_virtualgo $base0D $colorfg --bold set -x color_desk $base0D $colorfg --bold @@ -335,7 +335,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_username $base2 $blue --bold set -x color_hostname $base2 $blue set -x color_rvm $red $colorfg --bold - set -x color_nvm $green $colorfg --bold + set -x color_node $green $colorfg --bold set -x color_virtualfish $cyan $colorfg --bold set -x color_virtualgo $cyan $colorfg --bold set -x color_desk $cyan $colorfg --bold @@ -387,7 +387,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_username $base02 $blue --bold set -x color_hostname $base02 $blue set -x color_rvm $red $colorfg --bold - set -x color_nvm $green $colorfg --bold + set -x color_node $green $colorfg --bold set -x color_virtualfish $cyan $colorfg --bold set -x color_virtualgo $cyan $colorfg --bold set -x color_desk $cyan $colorfg --bold @@ -432,7 +432,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_username $grey[1] $blue[3] --bold set -x color_hostname $grey[1] $blue[3] set -x color_rvm $ruby_red $grey[1] --bold - set -x color_nvm $green $grey[1] --bold + set -x color_node $green $grey[1] --bold set -x color_virtualfish $blue[2] $grey[1] --bold set -x color_virtualgo $blue[2] $grey[1] --bold set -x color_desk $blue[2] $grey[1] --bold @@ -476,7 +476,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_username $fg[3] $blue[2] --bold set -x color_hostname $fg[3] $blue[2] set -x color_rvm $red[2] $fg[2] --bold - set -x color_nvm $green[1] $fg[2] --bold + set -x color_node $green[1] $fg[2] --bold set -x color_virtualfish $blue[2] $fg[2] --bold set -x color_virtualgo $blue[2] $fg[2] --bold set -x color_desk $blue[2] $fg[2] --bold @@ -522,7 +522,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_username $selection $cyan --bold set -x color_hostname $selection $cyan set -x color_rvm $red $bg --bold - set -x color_nvm $green $bg --bold + set -x color_node $green $bg --bold set -x color_virtualfish $comment $bg --bold set -x color_virtualgo $cyan $bg --bold set -x color_desk $comment $bg --bold @@ -574,7 +574,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_username $base02 $base0D --bold set -x color_hostname $base02 $base0D set -x color_rvm $base09 $colorfg --bold - set -x color_nvm $base09 $colorfg --bold + set -x color_node $base09 $colorfg --bold set -x color_virtualfish $base09 $colorfg --bold set -x color_virtualgo $base09 $colorfg --bold set -x color_desk $base09 $colorfg --bold @@ -619,7 +619,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_username $grey[1] $blue[3] --bold set -x color_hostname $grey[1] $blue[3] set -x color_rvm $ruby_red $grey[1] --bold - set -x color_nvm $green[1] $white --bold + set -x color_node $green[1] $white --bold set -x color_virtualfish $blue[2] $grey[1] --bold set -x color_virtualgo $go_blue $black --bold set -x color_desk $blue[2] $grey[1] --bold diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index e0a653e..a37fae6 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -39,7 +39,7 @@ # set -g theme_display_hostname ssh # set -g theme_display_sudo_user yes # set -g theme_display_vi no -# set -g theme_display_nvm yes +# set -g theme_display_node yes # set -g theme_avoid_ambiguous_glyphs yes # set -g theme_powerline_fonts no # set -g theme_nerd_fonts yes @@ -895,16 +895,33 @@ function __bobthefish_prompt_desk -S -d 'Display current desk environment' set_color normal end -function __bobthefish_prompt_nvm -S -d 'Display current node version through NVM' - [ "$theme_display_nvm" = 'yes' -a -n "$NVM_DIR" ] +function __bobthefish_prompt_node -S -d 'Display current node version' + [ "$theme_display_node" = "yes" -o "$theme_display_nvm" = 'yes' ] or return - set -l node_version (nvm current 2> /dev/null) + set -l node_manager + set -l node_manager_dir + + if type -fq nvm + set node_manager "nvm" + set node_manager_dir $NVM_DIR + else if type -fq fnm + set node_manager "fnm" + set node_manager_dir $FNM_DIR + end + + [ -n "$node_manager_dir" ] + or return + + set -l node_version ("$node_manager" current 2> /dev/null) [ -z $node_version -o "$node_version" = 'none' -o "$node_version" = 'system' ] and return - __bobthefish_start_segment $color_nvm + [ -n "$color_nvm" ] + and set -x color_node $color_nvm + + __bobthefish_start_segment $color_node echo -ns $node_glyph $node_version ' ' set_color normal end @@ -1124,7 +1141,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' __bobthefish_prompt_rubies __bobthefish_prompt_virtualfish __bobthefish_prompt_virtualgo - __bobthefish_prompt_nvm + __bobthefish_prompt_node set -l real_pwd (__bobthefish_pwd) From 27c4df467de350001d013c75d88eb128d59f662c Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sun, 24 Jan 2021 14:25:02 -0800 Subject: [PATCH 15/18] Minor code style cleanup. --- functions/fish_prompt.fish | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index a37fae6..94bd1a5 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -399,7 +399,7 @@ function __bobthefish_finish_segments -S -d 'Close open prompt segments' if set -q theme_newline_prompt echo -ens "$theme_newline_prompt" - else if [ "$theme_powerline_fonts" = "no" -a "$theme_nerd_fonts" != "yes" ] + else if [ "$theme_powerline_fonts" = 'no' -a "$theme_nerd_fonts" != 'yes' ] echo -ns '> ' else echo -ns "$right_arrow_glyph " @@ -641,12 +641,12 @@ function __bobthefish_prompt_k8s_context -S -d 'Show current Kubernetes context' and [ -z $namespace -o "$namespace" = 'default' ] and return - set -l segment $k8s_glyph " " $context + set -l segment $k8s_glyph ' ' $context [ -n "$namespace" ] - and set segment $segment ":" $namespace + and set segment $segment ':' $namespace __bobthefish_start_segment $color_k8s - echo -ns $segment " " + echo -ns $segment ' ' end @@ -669,17 +669,17 @@ function __bobthefish_prompt_aws_vault_profile -S -d 'Show AWS Vault profile' set -l diff_time $diff_mins"m" [ $diff_mins -le 0 ] - and set -l diff_time "0m" + and set -l diff_time '0m' [ $diff_mins -ge 60 ] and set -l diff_time (math "floor($diff_mins / 60)")"h"(math "$diff_mins % 60")"m" - set -l segment $profile " (" $diff_time ")" + set -l segment $profile ' (' $diff_time ')' set -l status_color $color_aws_vault [ $diff_mins -le 0 ] and set -l status_color $color_aws_vault_expired __bobthefish_start_segment $status_color - echo -ns $segment " " + echo -ns $segment ' ' end @@ -891,22 +891,22 @@ function __bobthefish_prompt_desk -S -d 'Display current desk environment' and return __bobthefish_start_segment $color_desk - echo -ns $desk_glyph ' ' (basename -a -s ".fish" "$DESK_ENV") ' ' + echo -ns $desk_glyph ' ' (basename -a -s '.fish' "$DESK_ENV") ' ' set_color normal end function __bobthefish_prompt_node -S -d 'Display current node version' - [ "$theme_display_node" = "yes" -o "$theme_display_nvm" = 'yes' ] + [ "$theme_display_node" = 'yes' -o "$theme_display_nvm" = 'yes' ] or return set -l node_manager set -l node_manager_dir if type -fq nvm - set node_manager "nvm" + set node_manager 'nvm' set node_manager_dir $NVM_DIR else if type -fq fnm - set node_manager "fnm" + set node_manager 'fnm' set node_manager_dir $FNM_DIR end @@ -919,7 +919,7 @@ function __bobthefish_prompt_node -S -d 'Display current node version' and return [ -n "$color_nvm" ] - and set -x color_node $color_nvm + and set -x color_node $color_nvm __bobthefish_start_segment $color_node echo -ns $node_glyph $node_version ' ' @@ -945,7 +945,7 @@ function __bobthefish_prompt_hg -S -a hg_root_dir -a real_pwd -d 'Display the ac set -l flags "$dirty" [ "$flags" ] - and set flags "" + and set flags '' set -l flag_colors $color_repo if [ "$dirty" ] @@ -1107,8 +1107,8 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' set -l last_status $status # Use a simple prompt on dumb terminals. - if [ "$TERM" = "dumb" ] - echo "> " + if [ "$TERM" = 'dumb' ] + echo '> ' return end From 2bd87a96b4f9fa507aaddd2654cdcccfc3f47a09 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sun, 24 Jan 2021 14:26:16 -0800 Subject: [PATCH 16/18] Bump. --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 093b08c..ba9a2db 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013-2014 Justin Hileman +Copyright (c) 2013-2021 Justin Hileman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From dcb5c9ea14b4f63cdd46ab3692853ae34ee68c51 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sun, 24 Jan 2021 14:31:28 -0800 Subject: [PATCH 17/18] Namespace .md reference links (to unbreak Themes.md in the OMF repo) --- README.md | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 8aa4f2b..85a6550 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # bobthefish -`bobthefish` is a Powerline-style, Git-aware [fish][fish] theme optimized for awesome. +`bobthefish` is a Powerline-style, Git-aware [fish][btf-fish] theme optimized for awesome. [![Oh My Fish](https://img.shields.io/badge/Framework-Oh_My_Fish-blue.svg?style=flat)](https://github.com/oh-my-fish/oh-my-fish) [![MIT License](https://img.shields.io/github/license/oh-my-fish/theme-bobthefish.svg?style=flat)](/LICENSE.md) -![bobthefish][screencast] +![bobthefish][btf-screencast] ### Installation @@ -13,15 +13,15 @@ Be sure to have Oh My Fish installed. Then just: omf install bobthefish -You will need a [Powerline-patched font][patching] for this to work, unless you enable the compatibility fallback option: +You will need a [Powerline-patched font][btf-patching] for this to work, unless you enable the compatibility fallback option: set -g theme_powerline_fonts no -[I recommend picking one of these][fonts]. For more advanced awesome, install a [nerd fonts patched font][nerd-fonts], and enable nerd fonts support: +[I recommend picking one of these][btf-fonts]. For more advanced awesome, install a [nerd fonts patched font][btf-nerd-fonts], and enable nerd fonts support: set -g theme_nerd_fonts yes -This theme is based loosely on [agnoster][agnoster]. +This theme is based loosely on [agnoster][btf-agnoster]. ### Features @@ -144,12 +144,12 @@ set -g theme_newline_prompt '$ ' **Color scheme options** -| ![dark][dark] | ![light][light] | -| ----------------------- | ----------------------------------- | -| ![solarized][solarized] | ![solarized-light][solarized-light] | -| ![base16][base16] | ![base16-light][base16-light] | -| ![zenburn][zenburn] | ![terminal-dark][terminal-dark] | -| ![nord][nord] | | +| ![dark][btf-dark] | ![light][btf-light] | +| --------------------------- | --------------------------------------- | +| ![solarized][btf-solarized] | ![solarized-light][btf-solarized-light] | +| ![base16][btf-base16] | ![base16-light][btf-base16-light] | +| ![zenburn][btf-zenburn] | ![terminal-dark][btf-terminal-dark] | +| ![nord][btf-nord] | | You can use the function `bobthefish_display_colors` to preview the prompts in any color scheme. @@ -230,19 +230,19 @@ end ``` -[fish]: https://github.com/fish-shell/fish-shell -[screencast]: https://cloud.githubusercontent.com/assets/53660/18028510/f16f6b2c-6c35-11e6-8eb9-9f23ea3cce2e.gif -[patching]: https://powerline.readthedocs.org/en/master/installation.html#patched-fonts -[fonts]: https://github.com/Lokaltog/powerline-fonts -[nerd-fonts]: https://github.com/ryanoasis/nerd-fonts -[agnoster]: https://gist.github.com/agnoster/3712874 - -[dark]: https://cloud.githubusercontent.com/assets/53660/16141569/ee2bbe4a-3411-11e6-85dc-3d9b0226e833.png "dark" -[light]: https://cloud.githubusercontent.com/assets/53660/16141570/f106afc6-3411-11e6-877d-fc2a8f6d3175.png "light" -[solarized]: https://cloud.githubusercontent.com/assets/53660/16141572/f7724032-3411-11e6-8771-b43769e7afec.png "solarized" -[solarized-light]: https://cloud.githubusercontent.com/assets/53660/16141575/fbed8036-3411-11e6-92e9-90da6d45f94b.png "solarized-light" -[base16]: https://cloud.githubusercontent.com/assets/53660/16141577/0134763a-3412-11e6-9cca-6040d39c8fd4.png "base16" -[base16-light]: https://cloud.githubusercontent.com/assets/53660/16141579/02f7245e-3412-11e6-97c6-5f3cecffb73c.png "base16-light" -[zenburn]: https://cloud.githubusercontent.com/assets/53660/16141580/06229dd4-3412-11e6-84aa-a48de127b6da.png "zenburn" -[terminal-dark]: https://cloud.githubusercontent.com/assets/53660/16141583/0b3e8eea-3412-11e6-8068-617c5371f6ea.png "terminal-dark" -[nord]: https://user-images.githubusercontent.com/39213657/72811435-f64ca800-3c5f-11ea-8711-dcce8cfc50fb.png "nord" +[btf-fish]: https://github.com/fish-shell/fish-shell +[btf-screencast]: https://cloud.githubusercontent.com/assets/53660/18028510/f16f6b2c-6c35-11e6-8eb9-9f23ea3cce2e.gif +[btf-patching]: https://powerline.readthedocs.org/en/master/installation.html#patched-fonts +[btf-fonts]: https://github.com/Lokaltog/powerline-fonts +[btf-nerd-fonts]: https://github.com/ryanoasis/nerd-fonts +[btf-agnoster]: https://gist.github.com/agnoster/3712874 + +[btf-dark]: https://cloud.githubusercontent.com/assets/53660/16141569/ee2bbe4a-3411-11e6-85dc-3d9b0226e833.png "dark" +[btf-light]: https://cloud.githubusercontent.com/assets/53660/16141570/f106afc6-3411-11e6-877d-fc2a8f6d3175.png "light" +[btf-solarized]: https://cloud.githubusercontent.com/assets/53660/16141572/f7724032-3411-11e6-8771-b43769e7afec.png "solarized" +[btf-solarized-light]: https://cloud.githubusercontent.com/assets/53660/16141575/fbed8036-3411-11e6-92e9-90da6d45f94b.png "solarized-light" +[btf-base16]: https://cloud.githubusercontent.com/assets/53660/16141577/0134763a-3412-11e6-9cca-6040d39c8fd4.png "base16" +[btf-base16-light]: https://cloud.githubusercontent.com/assets/53660/16141579/02f7245e-3412-11e6-97c6-5f3cecffb73c.png "base16-light" +[btf-zenburn]: https://cloud.githubusercontent.com/assets/53660/16141580/06229dd4-3412-11e6-84aa-a48de127b6da.png "zenburn" +[btf-terminal-dark]: https://cloud.githubusercontent.com/assets/53660/16141583/0b3e8eea-3412-11e6-8068-617c5371f6ea.png "terminal-dark" +[btf-nord]: https://user-images.githubusercontent.com/39213657/72811435-f64ca800-3c5f-11ea-8711-dcce8cfc50fb.png "nord" From 626bd39b002535d69e56adba5b58a1060cfb6d7b Mon Sep 17 00:00:00 2001 From: Nathan Gilbert Date: Wed, 27 Jan 2021 17:59:31 -0700 Subject: [PATCH 18/18] update check for nvm to allow for functions --- functions/fish_prompt.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index 94bd1a5..02bfe97 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -902,7 +902,7 @@ function __bobthefish_prompt_node -S -d 'Display current node version' set -l node_manager set -l node_manager_dir - if type -fq nvm + if type -q nvm set node_manager 'nvm' set node_manager_dir $NVM_DIR else if type -fq fnm