diff --git a/config/.gitconfig b/config/.gitconfig index 38aadf8..f93d98b 100644 --- a/config/.gitconfig +++ b/config/.gitconfig @@ -17,7 +17,7 @@ co = checkout c = commit --short ci = commit --short p = push -l = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --decorate --date=short +l = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --decorate --date=short --color --decorate [core] pager = delta diff --git a/config/fish/conf.d/onefetch.fish b/config/fish/conf.d/onefetch.fish deleted file mode 100644 index a27f8b6..0000000 --- a/config/fish/conf.d/onefetch.fish +++ /dev/null @@ -1,16 +0,0 @@ -# the following functions are here instead of in the functions directory -# because they utilize event handlers which autoloading does not support - -# auto run onefetch if inside git repo -# --on-variable is a fish builtin that changes whenever the directory changes -# so this function will run whenever the directory changes -function auto_onefetch --on-variable PWD - # check if .git/ exists and is a git repo and if onefetch is installed - if test -d .git && git rev-parse --git-dir >/dev/null 2>&1 - # onefetch - hub log -10 --reverse \ - --pretty=format:'* %Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' \ - --abbrev-commit --decorate --date=short --color \ - | devmoji --log --color - end -end diff --git a/config/fish/conf.d/pwd.fish b/config/fish/conf.d/pwd.fish new file mode 100644 index 0000000..76528db --- /dev/null +++ b/config/fish/conf.d/pwd.fish @@ -0,0 +1,26 @@ +# the following functions are here instead of in the functions directory +# because they utilize event handlers which autoloading does not support + +# auto run onefetch if inside git repo +# --on-variable is a fish builtin that changes whenever the directory changes +# so this function will run whenever the directory changes +function auto_pwd --on-variable PWD + # check if .git/ exists and is a git repo and if onefetch is installed + if test -d .git && git rev-parse --git-dir >/dev/null 2>&1 + # readme file + if test -f README.md + awk '/^##/{exit} 1' README.md | string trim \ + | glow -s dark -w 120 | grep -v 'Image: image' 2>&1 | head -20 | string trim -l -r + end + + # recent commits + echo "## Recent Activity" | glow -s dark -w 120 | string trim + hub l -10 \ + --since='1 week ago' \ + | devmoji --log --color \ + | sed 's/^/ /' + # local changes + echo "## Status" | glow -s dark -w 120 + hub -c color.ui=always st | sed 's/^/ /' + end +end