From 25840d3bc70c54beb3202a8772daf0f8deff9b67 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 21 Nov 2013 10:49:23 +0900 Subject: [PATCH 1/2] `-o bashdefault` instead of `-o default` --- fzf-completion.bash | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fzf-completion.bash b/fzf-completion.bash index e52a8f9..7e67d3b 100644 --- a/fzf-completion.bash +++ b/fzf-completion.bash @@ -53,8 +53,10 @@ _fzf_generic_completion() { matches=${matches% } if [ -n "$matches" ]; then COMPREPLY=( "$matches" ) - return 0 + else + COMPREPLY=( "$cur" ) fi + return 0 fi fi } @@ -81,7 +83,7 @@ complete -F _fzf_opts_completion fzf # Directory for cmd in "cd pushd rmdir"; do - complete -F _fzf_dir_completion -o default $cmd + complete -F _fzf_dir_completion -o bashdefault $cmd done # File @@ -90,7 +92,7 @@ for cmd in " emacs ex file ftp g++ gcc gvim head hg java javac ld less more mvim patch perl python ruby sed sftp sort source tail tee uniq vi view vim wc"; do - complete -F _fzf_file_completion -o default $cmd + complete -F _fzf_file_completion -o bashdefault $cmd done # Anything @@ -99,7 +101,7 @@ for cmd in " find git grep gunzip gzip hg jar ln ls mv open rm rsync scp svn tar unzip zip"; do - complete -F _fzf_all_completion -o default $cmd + complete -F _fzf_all_completion -o bashdefault $cmd done bind '"\e\e": complete' From a79760425553d76e662d4f1b2f03b6a1f851b02e Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 21 Nov 2013 11:38:14 +0900 Subject: [PATCH 2/2] -o default as well as -o bashdefault --- fzf-completion.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fzf-completion.bash b/fzf-completion.bash index 7e67d3b..410bb1e 100644 --- a/fzf-completion.bash +++ b/fzf-completion.bash @@ -83,7 +83,7 @@ complete -F _fzf_opts_completion fzf # Directory for cmd in "cd pushd rmdir"; do - complete -F _fzf_dir_completion -o bashdefault $cmd + complete -F _fzf_dir_completion -o default -o bashdefault $cmd done # File @@ -92,7 +92,7 @@ for cmd in " emacs ex file ftp g++ gcc gvim head hg java javac ld less more mvim patch perl python ruby sed sftp sort source tail tee uniq vi view vim wc"; do - complete -F _fzf_file_completion -o bashdefault $cmd + complete -F _fzf_file_completion -o default -o bashdefault $cmd done # Anything @@ -101,7 +101,7 @@ for cmd in " find git grep gunzip gzip hg jar ln ls mv open rm rsync scp svn tar unzip zip"; do - complete -F _fzf_all_completion -o bashdefault $cmd + complete -F _fzf_all_completion -o default -o bashdefault $cmd done bind '"\e\e": complete'