From 0c945b42695aa9eabb1d3eb33020851b21e226a1 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 24 Sep 2024 22:31:59 +0200 Subject: checkpoint --- config/essentials/shell/functions.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'config/essentials/shell/functions.sh') diff --git a/config/essentials/shell/functions.sh b/config/essentials/shell/functions.sh index cf10365..2a21655 100644 --- a/config/essentials/shell/functions.sh +++ b/config/essentials/shell/functions.sh @@ -348,3 +348,10 @@ prj () { [ -d "$d" ] || exit 1 cd "$pfx"/"$d" } + +edit_git_file () { + GIT_WORK_TREE="$1" GIT_DIR="$1"/.git git rev-parse --show-toplevel > /dev/null 2>&1 || return 1 + f="$(GIT_WORK_TREE="$1" GIT_DIR="$1"/.git git ls-files | fzf)" + [ "$f" ] || return 2 + $EDITOR "$1"/"$f" +} -- cgit v1.2.3