diff --git a/shell/completion.bash b/shell/completion.bash index 93369954..8805cb3d 100644 --- a/shell/completion.bash +++ b/shell/completion.bash @@ -9,6 +9,8 @@ # - $FZF_COMPLETION_TRIGGER (default: '**') # - $FZF_COMPLETION_OPTS (default: empty) +if [[ $- =~ i ]]; then + # To use custom commands instead of find, override _fzf_compgen_{path,dir} if ! declare -f _fzf_compgen_path > /dev/null; then _fzf_compgen_path() { @@ -330,3 +332,5 @@ complete -F _fzf_complete_export -o default -o bashdefault export complete -F _fzf_complete_unalias -o default -o bashdefault unalias unset cmd d_cmds a_cmds x_cmds + +fi diff --git a/shell/completion.zsh b/shell/completion.zsh index f6052592..37dbac45 100644 --- a/shell/completion.zsh +++ b/shell/completion.zsh @@ -9,6 +9,8 @@ # - $FZF_COMPLETION_TRIGGER (default: '**') # - $FZF_COMPLETION_OPTS (default: empty) +if [[ $- =~ i ]]; then + # To use custom commands instead of find, override _fzf_compgen_{path,dir} if ! declare -f _fzf_compgen_path > /dev/null; then _fzf_compgen_path() { @@ -192,3 +194,5 @@ fzf-completion() { zle -N fzf-completion bindkey '^I' fzf-completion + +fi