summaryrefslogtreecommitdiff
path: root/config/essentials/shell/functions.sh
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-09-24 22:31:59 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-09-24 22:31:59 +0200
commit0c945b42695aa9eabb1d3eb33020851b21e226a1 (patch)
treef4f9ec8a0f1d322dccb9f2154281655a28db6b89 /config/essentials/shell/functions.sh
parentf0fafea246dbecaf2cd80fc191f422215cf729f8 (diff)
checkpoint
Diffstat (limited to 'config/essentials/shell/functions.sh')
-rw-r--r--config/essentials/shell/functions.sh7
1 files changed, 7 insertions, 0 deletions
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"
+}