fzf cannot find any files

Created on 26 Feb 2016  路  5Comments  路  Source: junegunn/fzf

Installed both fzf and fzf.vim on a friend's device using vim-plug. fzf is not able to find any files. The list of files is always 0/0. Tried from both shell and vim, same result. Tried different directories, same result.

Opening Tags from inside vim works. It shows the list of tags from ctags file and I'm able to search through them.

What can be wrong here?

Most helpful comment

Just wanted to stop by to say the $SHELL -c "$FZF_DEFAULT_COMMAND" helped me debug this as well. My FZF_DEFAULT_COMMAND was set up to use ripgrep but I was passing in an invalid argument.

My FZF_DEFAULT_COMMAND was set up as:

export FZF_DEFAULT_COMMAND='rg --files --hidden --smartcase --follow --glob "!.git/*"'

Which produced this following error:

error: Found argument '--smartcase' which wasn't expected, or isn't valid in this context
    Did you mean --smart-case?

Changing it to use the correct --smart-case argument fixed the issue.

All 5 comments

When $FZF_DEFAULT_COMMAND is not set, fzf uses find command (and sed) to list the files. Check if this command works as expected:

find . -path '*/\.*' -prune -o -type f -print -o -type l -print 2> /dev/null | sed s/^..//

FZF_DEFAULT_COMMAND is set in bashrc like following.

export FZF_DEFAULT_COMMAND='if [ -f cscope.files ]; then cat cscope.files; else find ./ -type f ; fi'

I tried your command too, it works.

Is there any debugging that can be enabled to collect more information?

So, does it work when you unset the variable?
Also check if $SHELL -c "$FZF_DEFAULT_COMMAND" works.

Turns out $SHELL was defined to /bin/csh instead of /bin/bash. I fixed that and everything's working fine.

Thanks.

Just wanted to stop by to say the $SHELL -c "$FZF_DEFAULT_COMMAND" helped me debug this as well. My FZF_DEFAULT_COMMAND was set up to use ripgrep but I was passing in an invalid argument.

My FZF_DEFAULT_COMMAND was set up as:

export FZF_DEFAULT_COMMAND='rg --files --hidden --smartcase --follow --glob "!.git/*"'

Which produced this following error:

error: Found argument '--smartcase' which wasn't expected, or isn't valid in this context
    Did you mean --smart-case?

Changing it to use the correct --smart-case argument fixed the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jberglinds picture jberglinds  路  3Comments

olethanh picture olethanh  路  3Comments

ahmedelgabri picture ahmedelgabri  路  3Comments

chrisamow picture chrisamow  路  3Comments

sandric picture sandric  路  3Comments