diff --git a/dot_zshrc.tmpl b/dot_zshrc.tmpl index 757de3d..cf9fd31 100644 --- a/dot_zshrc.tmpl +++ b/dot_zshrc.tmpl @@ -64,6 +64,15 @@ if command -v tig &>/dev/null; then alias tiga='tig --all' fi +# Function to run after every 'cd' command +chpwd() { + # Check if the current directory is a Git repository + if git rev-parse --is-inside-work-tree 2>/dev/null; then + echo "Fetching latest changes from remote..." + git fetch + fi +} + # --------------------------------------------------------------------------- # Editor # ---------------------------------------------------------------------------