From ca409b699db3f566b45352f0bda54dc827865074 Mon Sep 17 00:00:00 2001 From: cornfeedhobo Date: Sun, 12 Jul 2020 12:33:29 -0500 Subject: [PATCH 1/2] minor cleanups to fzf plugin --- plugins/available/fzf.plugin.bash | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/available/fzf.plugin.bash b/plugins/available/fzf.plugin.bash index 4c672bbc..8ec1a467 100644 --- a/plugins/available/fzf.plugin.bash +++ b/plugins/available/fzf.plugin.bash @@ -4,14 +4,16 @@ cite about-plugin about-plugin 'load fzf, if you are using it' -if [ -f ~/.fzf.bash ]; then +_command_exists fzf || return + +if [ -r ~/.fzf.bash ]; then source ~/.fzf.bash -elif [ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash ]; then +elif [ -r "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash ]; then source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash fi -if [ -z ${FZF_DEFAULT_COMMAND+x} ]; then - command -v fd &> /dev/null && export FZF_DEFAULT_COMMAND='fd --type f' +if [ -z ${FZF_DEFAULT_COMMAND+x} ] && _command_exists fd ; then + export FZF_DEFAULT_COMMAND='fd --type f' fi fe() { From cf47e1f93e641da7af2b4a44d5ba6d6e11d58128 Mon Sep 17 00:00:00 2001 From: cornfeedhobo Date: Sun, 12 Jul 2020 12:37:00 -0500 Subject: [PATCH 2/2] nit pick spacing --- plugins/available/fzf.plugin.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/available/fzf.plugin.bash b/plugins/available/fzf.plugin.bash index 8ec1a467..c4f5ea84 100644 --- a/plugins/available/fzf.plugin.bash +++ b/plugins/available/fzf.plugin.bash @@ -6,9 +6,9 @@ about-plugin 'load fzf, if you are using it' _command_exists fzf || return -if [ -r ~/.fzf.bash ]; then +if [ -r ~/.fzf.bash ] ; then source ~/.fzf.bash -elif [ -r "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash ]; then +elif [ -r "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash ] ; then source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash fi