File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,10 +4,32 @@ if [[ ! "$PATH" == *${FZF_PATH}/bin* ]]; then
44 export PATH=" $PATH :${FZF_PATH} /bin"
55fi
66
7+ function _fzf_has() {
8+ which " $@ " > /dev/null 2>&1
9+ }
10+
11+ if _fzf_has brew; then
12+ # If fzf was installed via brew, use the brew paths
13+ if [[ -x " $( brew --prefix) /bin/fzf" ]]; then
14+ if [[ -f " $( brew --prefix fzf) /shell/completion.zsh" ]]; then
15+ source " $( brew --prefix fzf) /shell/completion.zsh" 2> /dev/null
16+ fi
17+ if [[ -f " $( brew --prefix fzf) /shell/key-bindings.zsh" ]]; then
18+ source " $( brew --prefix fzf) /shell/key-bindings.zsh"
19+ fi
20+ fi
21+ fi
22+
723# Auto-completion
824# ---------------
9- [[ $- == * i* ]] && source " ${FZF_PATH} /shell/completion.zsh" 2> /dev/null
25+ if [[ -f " ${FZF_PATH} /shell/completion.zsh" ]]; then
26+ [[ $- == * i* ]] && source " ${FZF_PATH} /shell/completion.zsh" 2> /dev/null
27+ fi
1028
1129# Key bindings
1230# ------------
13- source " ${FZF_PATH} /shell/key-bindings.zsh"
31+ if [[ -f " ${FZF_PATH} /shell/key-bindings.zsh" ]]; then
32+ source " ${FZF_PATH} /shell/key-bindings.zsh"
33+ fi
34+
35+ unset -f _fzf_has
You can’t perform that action at this time.
0 commit comments