From b7cd81cad2e4c1427f5b8af2842c5ecc50ff4263 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Sat, 21 Jan 2023 14:39:18 -0500 Subject: [PATCH] fish: add git information to prompt --- src/.config/fish/config.fish | 2 ++ src/.config/fish/functions/prompts.fish | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/.config/fish/config.fish b/src/.config/fish/config.fish index 1e8eee5..871390f 100644 --- a/src/.config/fish/config.fish +++ b/src/.config/fish/config.fish @@ -29,3 +29,5 @@ fish_vi_key_bindings bind -M insert \ce accept-autosuggestion -m default bind -M default \ce execute + +set __fish_git_prompt_showdirtystate 1 diff --git a/src/.config/fish/functions/prompts.fish b/src/.config/fish/functions/prompts.fish index 1a610ba..0222328 100644 --- a/src/.config/fish/functions/prompts.fish +++ b/src/.config/fish/functions/prompts.fish @@ -16,7 +16,10 @@ function fish_right_prompt set usercolor (set_color $col) end - printf '%s%s@%s%s' $usercolor \ + printf '%s ' \ + (fish_git_prompt) + printf '%s%s@%s%s'\ + $usercolor \ (echo $USER | string shorten -m 5 -c '') \ (echo $hostname | string shorten -m 1 -c '') \ (set_color normal)