This commit is contained in:
Alexander Navarro 2023-02-21 18:22:19 -03:00
parent 4524a86376
commit 0552ffdae8
37 changed files with 8770 additions and 49 deletions

49
config/fzf/forgitrc Normal file
View file

@ -0,0 +1,49 @@
forgit-list-command-widget() {
local cmd=$(alias | grep 'forgit' | sed -E 's/::/ /g; s/=/ :- /g; s/for//g' | \
awk -v BLD=${BLD} -v RST=${RST} -v BLU=${BLU} -v CYN=${CYN} -F":" '{print BLU BLD $1 RST ":" CYN $2 RST }' | \
column -ts":")
LBUFFER="$LBUFFER$( \
fzf-tmux -p -w 30% -h 53% --preview-window=hidden --prompt=' List > ' \
--header=$'Alias\t Description' <<< "$cmd" | awk '{print $1}')"
if [[ -n $LBUFFER ]]; then
zle accept-line
fi
zle reset-prompt
}
zle -N forgit-list-command-widget
bindkey '^[g^[l' forgit-list-command-widget #<Alt-G+Alt-L>
export FORGIT_FZF_SHOW_HELP_OPTS="$(
cat <<-EOF
Forgit Commands (Aliases)
fga add
fgbl blame
fgbd branch delete
fgcb checkout branch
fgco checkout commit
fgcf checkout file
fgct checkout tag
fgcp cherry pick
fgclean clean
fgd diff
fgfu fixup
fgi ignore
fglo log
fgrb rebase
fgrh reset head
fgrev revert commit
fgsta stash push
fgsts stash show
EOF
)"
export FORGIT_FZF_DEFAULT_OPTS="
--cycle
--reverse
--height '80%'
--preview-window=nohidden
--bind 'alt-?:preview(printf \"${FORGIT_FZF_SHOW_HELP_OPTS}\")'
"