Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fzf cannot find any files #510

Closed
ronakg opened this issue Feb 26, 2016 · 5 comments
Closed

fzf cannot find any files #510

ronakg opened this issue Feb 26, 2016 · 5 comments

Comments

@ronakg
Copy link

ronakg commented Feb 26, 2016

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?

@junegunn
Copy link
Owner

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/^..//

@ronakg
Copy link
Author

ronakg commented Feb 26, 2016

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?

@junegunn
Copy link
Owner

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

@ronakg
Copy link
Author

ronakg commented Feb 26, 2016

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

Thanks.

@ronakg ronakg closed this as completed Feb 26, 2016
@LeonardMH
Copy link

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.

@refacto refacto mentioned this issue Sep 26, 2017
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants