set up fzf bindings and hack for fzf git branch w/tmux

Alpha Chen 2 years ago committed by Alpha Chen
parent 0e48729e9a
commit b099a53431
Signed by: alpha
SSH Key Fingerprint: SHA256:3fOT8fiYQG/aK9ntivV3Bqtg8AYQ7q4nV6ZgihOA20g

@ -42,8 +42,6 @@ function eject { command hdiutil eject `df | grep Volumes | grep -i "$@" | ruby
eval "$(brew shellenv)" eval "$(brew shellenv)"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
if [ -e $HOMEBREW_PREFIX/opt/fzf/shell/completion.zsh ]; then if [ -e $HOMEBREW_PREFIX/opt/fzf/shell/completion.zsh ]; then
source $HOMEBREW_PREFIX/opt/fzf/shell/key-bindings.zsh source $HOMEBREW_PREFIX/opt/fzf/shell/key-bindings.zsh
source $HOMEBREW_PREFIX/opt/fzf/shell/completion.zsh source $HOMEBREW_PREFIX/opt/fzf/shell/completion.zsh
@ -56,6 +54,9 @@ if [ -x "$(command -v terraform)" ]; then
fi fi
if [ $commands[fzf] ]; then if [ $commands[fzf] ]; then
[[ $- == *i* ]] && source "/opt/homebrew/opt/fzf/shell/completion.zsh" 2> /dev/null
source "/opt/homebrew/opt/fzf/shell/key-bindings.zsh"
export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border' export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border'
export FZF_DEFAULT_COMMAND="fd --type f" export FZF_DEFAULT_COMMAND="fd --type f"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
@ -88,7 +89,8 @@ if [ $commands[fzf] ]; then
cut -c4- | sed 's/.* -> //' cut -c4- | sed 's/.* -> //'
} }
_gb() { # this B is capitalized so it maybe will work w/tmux?
_gB() {
is_in_git_repo || return is_in_git_repo || return
git branch -a --color=always | grep -v '/HEAD\s' | sort | git branch -a --color=always | grep -v '/HEAD\s' | sort |
fzf-down --ansi --multi --tac --preview-window right:70% \ fzf-down --ansi --multi --tac --preview-window right:70% \
@ -143,7 +145,7 @@ if [ $commands[fzf] ]; then
eval "bindkey '^g^$c' fzf-g$c-widget" eval "bindkey '^g^$c' fzf-g$c-widget"
done done
} }
bind-git-helper f b t r h s bind-git-helper f B t r h s
unset -f bind-git-helper unset -f bind-git-helper
if [ $commands[fasd] ]; then if [ $commands[fasd] ]; then

Loading…
Cancel
Save