diff --git a/zsh/.zshrc b/zsh/.zshrc index bea1075..7a9fb26 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -37,6 +37,18 @@ fi source $HOME/.cargo/env +lg() +{ + export LAZYGIT_NEW_DIR_FILE=~/.lazygit/newdir + + lazygit "$@" + + if [ -f $LAZYGIT_NEW_DIR_FILE ]; then + cd "$(cat $LAZYGIT_NEW_DIR_FILE)" + rm -f $LAZYGIT_NEW_DIR_FILE > /dev/null + fi +} + ## Give this an open tcp port and it would return it's PID ## I usually use this to kill processes