fish: add git information to prompt

This commit is contained in:
dogeystamp 2023-01-21 14:39:18 -05:00
parent 3926a85577
commit b7cd81cad2
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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)