]> arthur.barton.de Git - ax-zsh.git/blob - plugins/fzf/fzf.zshrc
Correctly test XDG_CACHE_HOME for writability for "stamp files"
[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         "$HOMEBREW_PREFIX"/opt/fzf/shell
29         /usr/local/lib/fzf/shell
30         /usr/local/opt/fzf/shell
31         /usr/local/share/examples/fzf/shell
32         /opt/fzf/shell
33         /usr/share/fzf/shell
34 ); do
35         [[ -d "$dir" ]] || continue
36         [[ -r "$dir/completion.zsh" ]] && source "$dir/completion.zsh"
37         source "$dir/key-bindings.zsh"
38         return 0
39 done
40 return 1