onefetch: display w/ cd

main
earnest ma 2022-02-21 10:05:25 -05:00
parent f0632827ae
commit 0204ae8a5d
Signed by: earnest ma
GPG Key ID: A343F43342EB6E2A
1 changed files with 16 additions and 1 deletions

View File

@ -102,6 +102,21 @@ magit() {
emacs --eval "(progn (magit-status) (delete-other-windows))"
}
# eye candy: auto onefetch (consider if this is really needed lol)
# https://www.reddit.com/r/unixporn/comments/sxa02o/oc_neofetch_for_git_repositories/
LAST_REPO=""
cd(){
builtin cd "$@"
git rev-parse 2>/dev/null
if [ $? -eq 0 ]; then
if [ "$LAST_REPO" != $(basename $(git rev-parse --show-toplevel)) ]; then
onefetch
LAST_REPO=$(basename $(git rev-parse --show-toplevel))
fi
fi
}
# PLUGINS!
# `miniplug update`