I want to be able to do a live fuzzy search on all source-controlled python files for example, or just all source-controlled files. Live, meaning updating in real time. Is there a way to do it?
Initially thought of telescope. It may be quite simple. But I am quite confused from all telescope's terms. There is https://github.com/davvid/telescope-git-grep.nvim which allow for non-fuzzy search, and there is live grep which allows for fuzzy search if you know how to use it. But it is on all files inside certain directory.
require'telescope.builtin'.grep_string{ shorten_path = true, word_match = "-w", only_sort_text = true, search = '' } A simpler question might be: Is there a way to filter on files when doing live grep that is also generic? (because getting the right file names is quite simple).
PS. I did commit and added to ripgrep an option of filelist that gets list that contains files https://github.com/BurntSushi/ripgrep/pull/2598 . I think it can be done with something like the following code :
function! GitF(onlypy) let tmp=getcwd() :exe ":cd ". expand("%:p:h") let top = systemlist("git rev-parse --show-toplevel")[0] echo top :exe ':cd '. top let a=systemlist("git ls-files --full-name" ) let a = (a:onlypy ? filter(a,{idx,val -> val =~ ".*py$"}): a) echo a :call writefile(a,'c:\temp\filelist.txt') "py3 t=[os.path.join(vim.eval("top"),y) for y in vim.eval("a")] "echo join(a,' --iglob ')mF :exec ":Leaderf rg " . ' --filelist c:\temp\filelist.txt' :exe ':cd '.tmp endfunction However, it still doesn't work for one reason or another. And I do prefer other plugin than leaderf.