summaryrefslogtreecommitdiff
path: root/fzf-completion.bash
diff options
context:
space:
mode:
Diffstat (limited to 'fzf-completion.bash')
-rw-r--r--fzf-completion.bash12
1 files changed, 3 insertions, 9 deletions
diff --git a/fzf-completion.bash b/fzf-completion.bash
index c4aca319..6697b372 100644
--- a/fzf-completion.bash
+++ b/fzf-completion.bash
@@ -46,12 +46,9 @@ _fzf_generic_completion() {
leftover=${base/#"$dir"}
leftover=${leftover/#\/}
[ "$dir" = './' ] && dir=''
+ tput sc
matches=$(find "$dir"* $1 2> /dev/null | fzf $FZF_COMPLETION_OPTS $2 -q "$leftover" | while read item; do
- if [[ ${item} =~ \ ]]; then
- echo -n "\"$item\" "
- else
- echo -n "$item "
- fi
+ printf '%q ' "$item"
done)
matches=${matches% }
if [ -n "$matches" ]; then
@@ -59,6 +56,7 @@ _fzf_generic_completion() {
else
COMPREPLY=( "$cur" )
fi
+ tput rc
return 0
fi
dir=$(dirname "$dir")
@@ -110,7 +108,3 @@ for cmd in "
complete -F _fzf_all_completion -o default -o bashdefault $cmd
done
-bind '"\e\e": complete'
-bind '"\er": redraw-current-line'
-bind '"\C-i": "\e\e\er"'
-