~razzi/fish-functions

ff1e888d162c31e1d785a41b7cee84846875902b — Razzi Abuissa 2 months ago 6f0840f
Add number of stashes to prompt
2 files changed, 9 insertions(+), 0 deletions(-)

M functions/fish_prompt.fish
A functions/in-git-dir.fish
M functions/fish_prompt.fish => functions/fish_prompt.fish +6 -0
@@ 18,6 18,12 @@ function fish_prompt --description 'Write out the prompt'
    set_color normal

    # printf '%s ' (__fish_git_prompt)
    if in-git-dir
        set stashes (git stash list | word-count)
        if test $stashes -gt 0
            printf '%s ' $stashes
        end
    end

    if not test $last_status -eq 0
        set_color $fish_color_error

A functions/in-git-dir.fish => functions/in-git-dir.fish +3 -0
@@ 0,0 1,3 @@
function in-git-dir
    git rev-parse --git-dir > /dev/null 2> /dev/null
end