helm/zsh/fzf
2015-12-22 06:08:38 -05:00

24 lines
555 B
Bash

#!/usr/bin/env zsh
local fzf_path="/usr/local/opt/fzf"
if [[ ! -d "$fzf_path" && -d "$HOME/.fzf" ]]; then
fzf_path="$HOME/.fzf"
else
return
fi
export FZF_DEFAULT_COMMAND='ag -g ""'
export FZF_DEFAULT_OPTS='--reverse --inline-info'
if [[ ! "$PATH" == *$fzf_path/bin* ]]; then
export PATH="$PATH:$fzf_path/bin"
fi
if [[ ! "$MANPATH" == *$fzf_path/man* && -d "$fzf_path/man" ]]; then
export MANPATH="$MANPATH:$fzf_path/man"
fi
is-interactive && source "$fzf_path/shell/completion.zsh" 2> /dev/null
source "$fzf_path/shell/key-bindings.zsh"