diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2015-12-29 00:00:20 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-12-29 00:21:38 +0900 |
| commit | e1dd798482490db6c43158d418973aa6e61659b7 (patch) | |
| tree | 35279c7813366b4dd5908ec5c19631cc78195509 /shell/completion.bash | |
| parent | c8a3f6f06a171fcb5fc7c8129c225999859d398e (diff) | |
| download | fzf-e1dd798482490db6c43158d418973aa6e61659b7.tar.gz | |
[bash/zsh-completion] List hidden files as well
Close #456 and #457
Diffstat (limited to 'shell/completion.bash')
| -rw-r--r-- | shell/completion.bash | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/shell/completion.bash b/shell/completion.bash index f40e25e0..191091d0 100644 --- a/shell/completion.bash +++ b/shell/completion.bash @@ -110,9 +110,9 @@ __fzf_generic_path_completion() { if [ -z "$dir" -o -d "$dir" ]; then leftover=${base/#"$dir"} leftover=${leftover/#\/} - [ "$dir" = './' ] && dir='' + [ -z "$dir" ] && dir='.' || dir="${dir/%\//}" tput sc - matches=$(find -L "$dir"* $1 2> /dev/null | $fzf $FZF_COMPLETION_OPTS $2 -q "$leftover" | while read item; do + matches=$(\find -L "$dir" $1 -a -not -path "$dir" -print 2> /dev/null | sed 's@^\./@@' | $fzf $FZF_COMPLETION_OPTS $2 -q "$leftover" | while read item; do printf "%q$3 " "$item" done) matches=${matches% } @@ -171,19 +171,19 @@ _fzf_complete() { _fzf_path_completion() { __fzf_generic_path_completion \ - "-name .git -prune -o -name .svn -prune -o -type d -print -o -type f -print -o -type l -print" \ + "-name .git -prune -o -name .svn -prune -o ( -type d -o -type f -o -type l )" \ "-m" "" "$@" } _fzf_file_completion() { __fzf_generic_path_completion \ - "-name .git -prune -o -name .svn -prune -o -type f -print -o -type l -print" \ + "-name .git -prune -o -name .svn -prune -o ( -type f -o -type l )" \ "-m" "" "$@" } _fzf_dir_completion() { __fzf_generic_path_completion \ - "-name .git -prune -o -name .svn -prune -o -type d -print" \ + "-name .git -prune -o -name .svn -prune -o -type d" \ "" "/" "$@" } |
