Yggdroot / LeaderF

An efficient fuzzy finder that helps to locate files, buffers, mrus, gtags, etc. on the fly for both vim and neovim.
Apache License 2.0
2.13k stars 180 forks source link

REPO project,Leadef files cannot find files under sub git repository #966

Closed JaminYoung closed 1 year ago

JaminYoung commented 1 year ago

Describe your question, feature request, or bug.

my latest project is managed by Repo, so there are several git repositories under sub-directory. In this case, I couldn't look up files under sub-directory which is managed by another git repository by using cmd "Leaderf files ".

I have tried several ways refrenced in history issues but failed in the end. first I tried add belows lines in vimrc

let g:Lf_UseVersionControlTool = 0
let g:Lf_DefaultExternalTool = "rg" 

then I run echo g:Lf_Debug_Cmd which output is rg --no-messages --files --color never which seems right, but I still can't files which is in other git repository

I also tried let g:Lf_ExternalCommand = 'rg --files %s' after run echo g:Lf_Debug_Cmd which output is rg --files "." and I still failed to look up files in under repository...

I confirm rg installed and works well as I type rg --files "xxx" , results show up instantly.

Steps to reproduce

Actual behaviour

Expected behaviour

Yggdroot commented 1 year ago

let g:Lf_RecurseSubmodules = 1

JaminYoung commented 1 year ago

Actually,I did try to set let g:Lf_RecurseSubmodules = 1 before, and didn't work again. after run echo g:Lf_Debug_Cmd which output is git ls-files --recurse-submodules "." && git ls-files --others --exclude-standard "."

Note that my project doesn't managed by git submodule but repo, which there are individual git repositories. I thought g:Lf_RecurseSubmodules should only works for git submodule

Yggdroot commented 1 year ago

What is the hierarchy of your Repo?

Yggdroot commented 1 year ago

Are the folders of other git repo in the .gitignore?

JaminYoung commented 1 year ago

-directory1 (git repository1) -directory2 (git repository1) --sub-directory1 (git repository2) ---sub-sub-directory1 (git repository3) -directory3 (git repository1)

Yggdroot commented 1 year ago

Run rg --no-messages --files --color never in the command line, I think it should work.

JaminYoung commented 1 year ago

Are the folders of other git repo in the .gitignore?

Are the folders of other git repo in the .gitignore?

yes, so it seems to be the reason? How can I exclude the .gitignore files whithout modifiled the .gitignore

Yggdroot commented 1 year ago

Leaderf file --no-ignore.

JaminYoung commented 1 year ago

Run rg --no-messages --files --color never in the command line, I think it should work.

I run rg --no-messages --files --color never > tmp_file, and files in sub-directory didn't exits in the tmp_files. but if run rg --files "xxx" > tmp_file, files in sub-directory match the pattern 'xxx' can be found

run Leaderf file --no-ignore only show up the directory'name in .gitignore which matchs the pattern , but files under sub-directory which matchs the patternstill can't be found

JaminYoung commented 1 year ago

set let g:Lf_UseVersionControlTool = 0 let g:Lf_DefaultExternalTool = "rg", plus with running Leaderf file --no-ignore works, confusing :)

JaminYoung commented 1 year ago

but I do want to exclude some files in .gitnore except the the sub-directory , is there any bettery way to acchive this?

JaminYoung commented 1 year ago

using g:Lf_WildIgnore would will fix this, thank you so much

416207298 commented 12 months ago

How to auto execute this command Leaderf file --no-ignore when enter vim ? I've tried to write down autocmd BufWinEnter Leaderf file --no-ignore in .vimrc but it did not work.

416207298 commented 12 months ago

Finally, I write like this to solve that:

func OpenLeaderF()
  :Leaderf file --no-ignore
  :LeaderfFile
endfunc

nnoremap <c-p> :call OpenLeaderF()<cr>