1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-12-19 02:41:57 +00:00

perf(fzf): speed up startup on debian (#11122)

This commit is contained in:
Yuxin Wu 2023-01-21 02:36:07 -08:00 committed by GitHub
parent bf57b4ff3d
commit ba8777fc30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,8 +60,8 @@ function fzf_setup_using_base_dir() {
function fzf_setup_using_debian() { function fzf_setup_using_debian() {
if (( ! $+commands[dpkg] )) || ! dpkg -s fzf &>/dev/null; then if (( ! $+commands[dpkg] )); then
# Either not a debian based distro, or no fzf installed # Not a debian based distro
return 1 return 1
fi fi
@ -72,11 +72,19 @@ function fzf_setup_using_debian() {
case $PREFIX in case $PREFIX in
*com.termux*) *com.termux*)
if [[ ! -f "${PREFIX}/bin/fzf" ]]; then
# fzf not installed
return 1
fi
# Support Termux package # Support Termux package
completions="${PREFIX}/share/fzf/completion.zsh" completions="${PREFIX}/share/fzf/completion.zsh"
key_bindings="${PREFIX}/share/fzf/key-bindings.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 # Determine completion file path: first bullseye/sid, then buster/stretch
completions="/usr/share/doc/fzf/examples/completion.zsh" completions="/usr/share/doc/fzf/examples/completion.zsh"
[[ -f "$completions" ]] || completions="/usr/share/zsh/vendor-completions/_fzf" [[ -f "$completions" ]] || completions="/usr/share/zsh/vendor-completions/_fzf"