diff options
author | Yuxin Wu <ppwwyyxxc@gmail.com> | 2023-01-21 02:36:07 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-21 11:36:07 +0100 |
commit | ba8777fc3013a3c682d8144586e16457cbe12586 (patch) | |
tree | 4dd5acdd808ed9474c8bb19d230a8c410da0338a /plugins/fzf/fzf.plugin.zsh | |
parent | bf57b4ff3d53726a1317459b0f48853e90d7a6e4 (diff) | |
download | zsh-ba8777fc3013a3c682d8144586e16457cbe12586.tar.gz zsh-ba8777fc3013a3c682d8144586e16457cbe12586.tar.bz2 zsh-ba8777fc3013a3c682d8144586e16457cbe12586.zip |
perf(fzf): speed up startup on debian (#11122)
Diffstat (limited to 'plugins/fzf/fzf.plugin.zsh')
-rw-r--r-- | plugins/fzf/fzf.plugin.zsh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh index 9c8dd8648..85a0bf270 100644 --- a/plugins/fzf/fzf.plugin.zsh +++ b/plugins/fzf/fzf.plugin.zsh @@ -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[dpkg] )); 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 [[ ! -f /usr/bin/fzf ]]; 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" |