diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2023-03-18 16:23:39 -0700 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2023-03-18 16:23:39 -0700 |
commit | 4b0bbc0b263a150eb9a9b59f196914629be06a9b (patch) | |
tree | 619723cfa449f93149b766ee397f85ce2acef5f7 /plugins/fzf | |
parent | db7efd2336e4dbe6abf321b00dbc11bc5afb1355 (diff) | |
parent | 72732a224e886933df6b64a49ec6f5e94c884612 (diff) | |
download | zsh-4b0bbc0b263a150eb9a9b59f196914629be06a9b.tar.gz zsh-4b0bbc0b263a150eb9a9b59f196914629be06a9b.tar.bz2 zsh-4b0bbc0b263a150eb9a9b59f196914629be06a9b.zip |
Merge remote-tracking branch 'github/master'
Diffstat (limited to 'plugins/fzf')
-rw-r--r-- | plugins/fzf/fzf.plugin.zsh | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh index 9c8dd8648..b253a23d2 100644 --- a/plugins/fzf/fzf.plugin.zsh +++ b/plugins/fzf/fzf.plugin.zsh @@ -9,7 +9,7 @@ function fzf_setup_using_base_dir() { "${HOME}/.nix-profile/share/fzf" "${XDG_DATA_HOME:-$HOME/.local/share}/fzf" "/usr/local/opt/fzf" - "/opt/homebrew/bin/fzf" + "/opt/homebrew/opt/fzf" "/usr/share/fzf" "/usr/local/share/examples/fzf" ) @@ -60,8 +60,8 @@ function fzf_setup_using_base_dir() { function fzf_setup_using_debian() { - if (( ! $+commands[dpkg] )) || ! dpkg -s fzf &>/dev/null; then - # Either not a debian based distro, or no fzf installed + if (( ! $+commands[apt] && ! $+commands[apt-get] )); then + # Not a debian based distro return 1 fi @@ -72,11 +72,19 @@ function fzf_setup_using_debian() { case $PREFIX in *com.termux*) + if [[ ! -f "${PREFIX}/bin/fzf" ]]; then + # fzf not installed + return 1 + fi # Support Termux package completions="${PREFIX}/share/fzf/completion.zsh" key_bindings="${PREFIX}/share/fzf/key-bindings.zsh" ;; *) + if [[ ! -d /usr/share/doc/fzf/examples ]]; then + # fzf not installed + return 1 + fi # Determine completion file path: first bullseye/sid, then buster/stretch completions="/usr/share/doc/fzf/examples/completion.zsh" [[ -f "$completions" ]] || completions="/usr/share/zsh/vendor-completions/_fzf" |