]> arthur.barton.de Git - ax-zsh.git/blob - plugins/fzf/fzf.zshrc
85bcc37229f5cba9e75fd45b5323e11518d0352c
[ax-zsh.git] / plugins / fzf / fzf.zshrc
1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # fzf.zshrc: Setup Git
3
4 axzsh_is_modern_terminal || return 91
5
6 # Test for local fzf installation ...
7 if [[ -r ~/.fzf.zsh ]]; then
8         source ~/.fzf.zsh
9         return 0
10 fi
11
12 # Make sure that "fzf(1)" is installed
13 (( $+commands[fzf] )) || return 1
14
15 # Test for Debian-specific keybinding location ...
16 if [[ -r /usr/share/doc/fzf/examples/key-bindings.zsh ]]; then
17         if [[ -r /usr/share/doc/fzf/examples/completion.zsh ]]; then
18                 source /usr/share/doc/fzf/examples/completion.zsh
19         elif [[ -r /usr/share/zsh/vendor-completions/_fzf ]]; then
20                 source /usr/share/zsh/vendor-completions/_fzf
21         fi
22         source /usr/share/doc/fzf/examples/key-bindings.zsh
23         return 0
24 fi
25
26 # Search for and read in FZF ZSH integration files
27 for dir (
28         /usr/local/lib/fzf/shell
29         /usr/local/opt/fzf/shell
30         /usr/local/share/examples/fzf/shell
31         /opt/fzf/shell
32 ); do
33         [[ -d "$dir" ]] || continue
34         source "$dir/completion.zsh"
35         source "$dir/key-bindings.zsh"
36         return 0
37 done
38 return 1