now able to suspend from editor process

This commit is contained in:
Matthias Johnson 2025-03-23 11:08:06 -06:00
parent ba06a0c356
commit 306c72e58a

View file

@ -21,28 +21,30 @@ alias .glgp='.g log --stat --patch'
# if fzf is installed we can have nice things # if fzf is installed we can have nice things
# https://github.com/junegunn/fzf # https://github.com/junegunn/fzf
if [[ $(command -v fzf) ]]; then if [[ $(command -v fzf) ]]; then
# shellcheck disable=SC2142,SC215 fzf_opts=(--preview "bat -n --color=always {}"
alias .ge='_dotgit_ge(){ --multi --ansi -0
cd ${DOT_HOME} --preview-window "right,60%,<60(down,75%),+{2}/2"
.g ls-files --full-name | --bind 'ctrl-z:ignore'
fzf -0 --bind "enter:execute($EDITOR {})" \ )
--preview "bat -n --color=always {}" \ _dotgit_ge() {
--preview-window "right,60%,<60(down,75%),+{2}/2" \ files=$(cd "$DOT_HOME" && .g ls-files --full-name |
-q "${@:-}" fzf "${fzf_opts[@]}" \
cd ${OLDPWD} --preview "bat --color=always {1}" \
unset -f _dotgit_ge; --bind "enter:accept-non-empty" \
}; _dotgit_ge' -q "${@:-}" | paste -sd' ')
[[ -n "$files" ]] && sh -c "cd $DOT_HOME && $EDITOR $files"
}
alias .ge='_dotgit_ge'
# shellcheck disable=SC2142 _dotgit_gg() {
alias .gg='_dotgit_gg(){ files=$(cd "$DOT_HOME" && .g grep --full-name --color=always -n "$@" |
cd ${DOT_HOME} fzf "${fzf_opts[@]}" -d ":" \
.g grep --full-name --color=always -n "$@" | --preview "bat --color=always -H{2} {1}" \
fzf -0 --ansi -d ":" --bind "enter:execute($EDITOR +{2} {1})" \ --accept-nth "-c 'e {1}|{2}'" | paste -sd' ')
--preview "bat -n -H {2} --color=always {1}" \ [[ -n "$files" ]] && sh -c "cd $DOT_HOME && $EDITOR $files"
--preview-window "right,60%,<60(down,75%),+{2}/2" }
cd ${OLDPWD} # shellcheck disable=SC2154
unset -f _dotgit_gg; alias .gg='_dotgit_gg' # | read -r f; echo $f'
}; _dotgit_gg'
else else
# simplified grep but no "interactive file select" # simplified grep but no "interactive file select"
alias .gg='.g grep' alias .gg='.g grep'