From d2a27a69a700ecafdbee07043dd5ee0c01c06476 Mon Sep 17 00:00:00 2001 From: Lanre Adelowo Date: Fri, 14 Jul 2023 12:17:59 +0100 Subject: [PATCH] add lazygit fn --- zsh/.zshrc | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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