2015-12-22 00:56:36 -08:00
|
|
|
local fzf_path="/usr/local/opt/fzf"
|
|
|
|
if [[ ! -d "$fzf_path" && -d "$HOME/.fzf" ]]; then
|
|
|
|
fzf_path="$HOME/.fzf"
|
|
|
|
else
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2015-12-21 00:11:28 -08:00
|
|
|
# Setup fzf
|
|
|
|
# ---------
|
2015-12-22 00:56:36 -08:00
|
|
|
if [[ ! "$PATH" == *$fzf_path/bin* ]]; then
|
|
|
|
export PATH="$PATH:$fzf_path/bin"
|
2015-12-21 00:11:28 -08:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Man path
|
|
|
|
# --------
|
2015-12-22 00:56:36 -08:00
|
|
|
if [[ ! "$MANPATH" == *$fzf_path/man* && -d "$fzf_path/man" ]]; then
|
|
|
|
export MANPATH="$MANPATH:$fzf_path/man"
|
2015-12-21 00:11:28 -08:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Auto-completion
|
|
|
|
# ---------------
|
2015-12-22 00:56:36 -08:00
|
|
|
[[ $- == *i* ]] && source "$fzf_path/shell/completion.bash" 2> /dev/null
|
2015-12-21 00:11:28 -08:00
|
|
|
|
|
|
|
# Key bindings
|
|
|
|
# ------------
|
2015-12-22 00:56:36 -08:00
|
|
|
source "$fzf_path/shell/key-bindings.bash"
|
2015-12-21 00:11:28 -08:00
|
|
|
|