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

Can not find the file if whe workspace includes multi-repos. #971

Closed swordligit closed 1 year ago

swordligit commented 1 year ago

let g:Lf_ShortcutF = "ff" noremap m :=printf("Leaderf mru %s", "") noremap b :=printf("Leaderf buffer %s", "") noremap ft :=printf("Leaderf bufTag %s", "") noremap fl :=printf("Leaderf line %s", "")

" noremap :=printf("Leaderf! rg --current-buffer -e %s ", expand("")) " noremap :=printf("Leaderf! rg -e %s ", expand("")) noremap fb :=printf("Leaderf! rg --current-buffer -e %s ", expand("")) noremap fe :=printf("Leaderf! rg -e %s ", expand(""))

" search visually selected text literally xnoremap fg :=printf("Leaderf! rg -F -e %s ", leaderf#Rg#visual()) noremap go :Leaderf! rg --recall

" should use Leaderf gtags --update first let g:Lf_GtagsAutoGenerate = 0 let g:Lf_Gtagslabel = 'native-pygments' noremap fr :=printf("Leaderf! gtags -r %s --auto-jump", expand("")) noremap fd :=printf("Leaderf! gtags -d %s --auto-jump", expand("")) noremap fo :=printf("Leaderf! gtags --recall %s", "") noremap fn :=printf("Leaderf gtags --next %s", "") noremap fp :=printf("Leaderf gtags --previous %s", "")



### Describe your question, feature request, or bug.
when input the \<leader\>ff, which call :<C-U>LeaderfFile<CR>,it can not find myfile.
### Steps to reproduce
I have a large code base, and use the android repo tool, the file I search is not
in the currently git repo.
1, repo list:
 : smartos
apps : nuttx_apps
framework/services : services
mirtos : nuttx
2. find . -name rptun.h -type f
./mirtos/nuttx/drivers/rptun/rptun.h
./mirtos/nuttx/include/nuttx/rptun/rptun.h
3. LeaderfFile
### Actual behaviour
can not find rptun.h

### Expected behaviour
should list the rptun.h, at least two files.
swordligit commented 1 year ago

Interesting, if I move all the .git in the workspace, it will list the files.

Yggdroot commented 1 year ago

Leaderf file --no-ignore

swordligit commented 1 year ago

That works, thank a lot. but how to customized the shortcut? I change the file to

diff --git a/plugin/leaderf.vim b/plugin/leaderf.vim
index 54d28b4..13f7c9a 100644
--- a/plugin/leaderf.vim
+++ b/plugin/leaderf.vim
@@ -245,7 +245,7 @@ command! -bar -nargs=0 LeaderfLocList  Leaderf loclist

 try
     if g:Lf_ShortcutF != ""
-        exec 'nnoremap <silent><unique> ' g:Lf_ShortcutF ':<C-U>LeaderfFile<CR>'
+        exec 'nnoremap <silent><unique> ' g:Lf_ShortcutF ':<C-U>LeaderfFile --no-ignore<CR>'
     endif
 catch /^Vim\%((\a\+)\)\=:E227/
 endtry 
Yggdroot commented 1 year ago

noremap <leader>ff :<C-U>Leaderf file --no-ignore<CR>

swordligit commented 1 year ago

It works, thank you!