init
This commit is contained in:
22
functions/fish_right_prompt.fish.bak
Normal file
22
functions/fish_right_prompt.fish.bak
Normal file
@@ -0,0 +1,22 @@
|
||||
function fish_right_prompt --description 'right prompt'
|
||||
|
||||
#### git
|
||||
if git rev-parse --is-inside-work-tree ^/dev/null >/dev/null
|
||||
printf "%s[git:" (set_color brblack)
|
||||
|
||||
if not git diff-files --quiet ^/dev/null >/dev/null
|
||||
# changes
|
||||
printf " %s%s" (set_color red) (git diff-files | grep -c .)
|
||||
end
|
||||
if not git diff-index --quiet --cached HEAD -- ^/dev/null >/dev/null
|
||||
# cached changes
|
||||
printf " %s%s" (set_color green) (git diff-index --cached HEAD -- ^/dev/null | grep -c .)
|
||||
end
|
||||
|
||||
set -l branch (git symbolic-ref --short HEAD ^/dev/null)
|
||||
printf " %s%s" (set_color cyan) (string trim $branch)
|
||||
|
||||
printf "%s]" (set_color brblack)
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user