Skip to content
Myr

[bash] Revert skipping setting up fuzzy path completion

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This partially reverts a2d0e8f not to break backward compatibility.

authored by Junegunn Choi · committed by Junegunn Choi · parent 8cb59e6 · Browse files · 1 file+21 added−22 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+21 added−22 removed

  • other:+21 added−22 removed

1 file+21 added−22 removed

modified:shell/completion.bash+21 added-22 removed
494 unmodified lines
495 return 124496 fi497}498499if complete | command grep -q __fzf_default_completion; then500 : # Default completion already set up. Do nothing.501elif ! complete | command grep -- '-D$' | command grep -qv _comp_complete_load &&502 complete -D -F __fzf_default_completion -o default -o bashdefault 2> /dev/null; then503 a_cmds=""504else505 # We can't set up default completion,506 # 1. if it's already set up by another script507 # 2. or if the current version of bash doesn't support -D option508 #509 # NOTE: $FZF_COMPLETION_PATH_COMMANDS and $FZF_COMPLETION_VAR_COMMANDS are510 # undocumented and subject to change in the future.511 a_cmds="${FZF_COMPLETION_PATH_COMMANDS-"512 awk bat cat code diff diff3513 emacs emacsclient ex file ftp g++ gcc gvim head hg hx java514 javac ld less more mvim nvim patch perl python ruby515 sed sftp sort source tail tee uniq vi view vim wc xdg-open516 basename bunzip2 bzip2 chmod chown curl cp dirname du517 find git grep gunzip gzip hg jar518 ln ls mv open rm rsync scp519 svn tar unzip zip"}"520fi499# Set fuzzy path completion as the default completion for all commands.500# We can't set up default completion,501# 1. if it's already set up by another script502# 2. or if the current version of bash doesn't support -D option503complete | command grep -q __fzf_default_completion ||504 complete | command grep -- '-D$' | command grep -qv _comp_complete_load ||505 complete -D -F __fzf_default_completion -o default -o bashdefault 2> /dev/null506507d_cmds="${FZF_COMPLETION_DIR_COMMANDS-cd pushd rmdir}"508509# NOTE: $FZF_COMPLETION_PATH_COMMANDS and $FZF_COMPLETION_VAR_COMMANDS are510# undocumented and subject to change in the future.511#512# NOTE: Although we have default completion, we still need to set up completion513# for each command in case they already have completion set up by another script.514a_cmds="${FZF_COMPLETION_PATH_COMMANDS-"515 awk bat cat code diff diff3516 emacs emacsclient ex file ftp g++ gcc gvim head hg hx java517 javac ld less more mvim nvim patch perl python ruby518 sed sftp sort source tail tee uniq vi view vim wc xdg-open519 basename bunzip2 bzip2 chmod chown curl cp dirname du520 find git grep gunzip gzip hg jar521 ln ls mv open rm rsync scp522 svn tar unzip zip"}"523v_cmds="${FZF_COMPLETION_VAR_COMMANDS-export unset printenv}"524525# Preserve existing completion526__fzf_orig_completion < <(complete -p $d_cmds $a_cmds $v_cmds unalias kill ssh 2> /dev/null)
72 unmodified lines