add base setup with dotter

This commit is contained in:
Alexander Navarro 2024-11-08 22:53:56 +00:00 committed by aleidk
parent 6b0da868bb
commit 42e6595b60
177 changed files with 1062 additions and 70 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}\")'
"