|
|
@ -189,13 +189,14 @@ _fzf_git_stashes() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if [[ -n $BASH_VERSION ]]; then
|
|
|
|
if [[ -n $BASH_VERSION ]]; then
|
|
|
|
|
|
|
|
__fzf_git_init() {
|
|
|
|
bind '"\er": redraw-current-line'
|
|
|
|
bind '"\er": redraw-current-line'
|
|
|
|
bind '"\C-g\C-f": "$(_fzf_git_files)\e\C-e\er"'
|
|
|
|
local o
|
|
|
|
bind '"\C-g\C-b": "$(_fzf_git_branches)\e\C-e\er"'
|
|
|
|
for o in "$@"; do
|
|
|
|
bind '"\C-g\C-t": "$(_fzf_git_tags)\e\C-e\er"'
|
|
|
|
bind '"\C-g\C-'${o:0:1}'": "$(_fzf_git_'$o')\e\C-e\er"'
|
|
|
|
bind '"\C-g\C-h": "$(_fzf_git_hashes)\e\C-e\er"'
|
|
|
|
bind '"\C-g'${o:0:1}'": "$(_fzf_git_'$o')\e\C-e\er"'
|
|
|
|
bind '"\C-g\C-r": "$(_fzf_git_remotes)\e\C-e\er"'
|
|
|
|
done
|
|
|
|
bind '"\C-g\C-s": "$(_fzf_git_stashes)\e\C-e\er"'
|
|
|
|
}
|
|
|
|
elif [[ -n $ZSH_VERSION ]]; then
|
|
|
|
elif [[ -n $ZSH_VERSION ]]; then
|
|
|
|
__fzf_git_join() {
|
|
|
|
__fzf_git_join() {
|
|
|
|
local item
|
|
|
|
local item
|
|
|
@ -206,14 +207,15 @@ elif [[ -n $ZSH_VERSION ]]; then
|
|
|
|
|
|
|
|
|
|
|
|
__fzf_git_init() {
|
|
|
|
__fzf_git_init() {
|
|
|
|
local o
|
|
|
|
local o
|
|
|
|
for o in $@; do
|
|
|
|
for o in "$@"; do
|
|
|
|
eval "fzf-git-$o-widget() { local result=\$(_fzf_git_$o | __fzf_git_join); zle reset-prompt; LBUFFER+=\$result }"
|
|
|
|
eval "fzf-git-$o-widget() { local result=\$(_fzf_git_$o | __fzf_git_join); zle reset-prompt; LBUFFER+=\$result }"
|
|
|
|
eval "zle -N fzf-git-$o-widget"
|
|
|
|
eval "zle -N fzf-git-$o-widget"
|
|
|
|
eval "bindkey '^g^${o[1]}' fzf-git-$o-widget"
|
|
|
|
eval "bindkey '^g^${o[1]}' fzf-git-$o-widget"
|
|
|
|
|
|
|
|
eval "bindkey '^g${o[1]}' fzf-git-$o-widget"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
}
|
|
|
|
}
|
|
|
|
__fzf_git_init files branches tags remotes hashes stashes
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
__fzf_git_init files branches tags remotes hashes stashes
|
|
|
|
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|