#W# Initial Commit: No Flake Config
This commit is contained in:
commit
c463cec3e2
74 changed files with 14898 additions and 0 deletions
19
home/config/fish/functions/gitinfo.fish
Normal file
19
home/config/fish/functions/gitinfo.fish
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
function gitinfo
|
||||
if git rev-parse --is-inside-work-tree >/dev/null 2>&1
|
||||
set -l branch (git branch --show-current)
|
||||
set -l staged ""
|
||||
set -l dirty ""
|
||||
set -l untracked ""
|
||||
if not git diff --quiet
|
||||
set dirty (set_color yellow)"*"
|
||||
end
|
||||
if not git diff --cached --quiet
|
||||
set staged (set_color green)"+"
|
||||
end
|
||||
set -l untracked_files (git ls-files --others --exclude-standard)
|
||||
if test -n "$untracked_files"
|
||||
set untracked (set_color red)" *"
|
||||
end
|
||||
echo (set_color magenta)"($branch)"$staged$dirty$untracked(set_color normal)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue