Merge pull request #1998 from tsiflimagas/fzf-plugin

Fix checking whether fzf is already in PATH
pull/1991/head
Noah Gorny 2022-01-03 13:33:14 +02:00 committed by GitHub
commit f0abc3fbc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -4,14 +4,15 @@
cite about-plugin cite about-plugin
about-plugin 'load fzf, if you are using it' 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 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 source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash
fi fi
# No need to continue if the command is not present
_command_exists fzf || return
if [ -z ${FZF_DEFAULT_COMMAND+x} ] && _command_exists fd ; then if [ -z ${FZF_DEFAULT_COMMAND+x} ] && _command_exists fd ; then
export FZF_DEFAULT_COMMAND='fd --type f' export FZF_DEFAULT_COMMAND='fd --type f'
fi fi