diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-09-24 22:31:59 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-09-24 22:31:59 +0200 |
commit | 0c945b42695aa9eabb1d3eb33020851b21e226a1 (patch) | |
tree | f4f9ec8a0f1d322dccb9f2154281655a28db6b89 /config/essentials/shell/functions.sh | |
parent | f0fafea246dbecaf2cd80fc191f422215cf729f8 (diff) |
checkpoint
Diffstat (limited to 'config/essentials/shell/functions.sh')
-rw-r--r-- | config/essentials/shell/functions.sh | 7 |
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" +} |