nvim-telescope / telescope-file-browser.nvim

File Browser extension for telescope.nvim
MIT License
1.6k stars 89 forks source link

fzf as THE search engine for faster results pasing #379

Closed MikeLemo1 closed 3 months ago

MikeLemo1 commented 3 months ago

Is your feature request related to a problem? Please describe. So everytime I make a search in the .config directory with the file browser it tends to get super laggy and slow as opposed to fzf where I swiftly search and find resultsz even in the root dir /

Describe the solution you'd like Change search engine to use fzf's

jamestrew commented 3 months ago

What specifically is slow? The initial load time to get results or the filtering with the prompt? If it's the latter, you can use https://github.com/nvim-telescope/telescope-fzf-native.nvim to use the same scoring algorithm as fzf written in C to get better performance that what comes by default with telescope.

Otherwise, it's not as easy as using fzf as a "search engine". By default, telescope-file-browser shows file/folder stat, git info, buffer previews, highlighting for all of these. All of these can be disabled (display_stat=false, git_status=false, previewer=false). Also you might not be using fd. Also you might be using grouped=true which sorts and groups folders and files together.

Like I say, fzf and this plugin aren't equivalent. Yes, fzf is faster than anything in telescope. This is just a trade off we're making.

MikeLemo1 commented 3 months ago

so here is the thing both are slow and yes I can't seem to see a find_comand option in file-browser to change the command too fd like in :Telescope find_files I have around 700K files in my home dir, I have set the depth options to search recursivelly for all sub directories and it takes arounnd 20 seconds to load the entries and after that every keystroke is quite laggy sorting and redrawing results, taking a few seconds to refresh between each stroke.

if the base is'nt done proper you might as well make a create a browser from 0

jamestrew commented 3 months ago

The goal of this plugin isn't to be a file browser for 700k files I'm sorry. Like I said, telescope in general is always going to be slower than native CLI tools like fd piped into fzf. Plugin's like fzf.vim and fzf-lua are probably closer to what you're looking for if performance is a priority for you. But neither offer a file browser type command/picker...

MikeLemo1 commented 3 months ago

Yeah but even regular use with the entities parsing and sorting is laggy to an almost unusable state so as I had an idea that integrating fzf into vim'd easy for some this'd an efficient idea. I don't see why using something worse for no reason is there are no too greate thech challenges unless you are a masochist XD

jamestrew commented 3 months ago

I don't see why using something worse for no reason is there are no too greate thech challenges unless you are a masochist XD

I'm gonna stop you right there. I'll repeat again:

Like I say, fzf and this plugin aren't equivalent. Yes, fzf is faster than anything in telescope. This is just a trade off we're making.

If this plugin or telescope as a whole isn't meeting your requirements, you're free to use something like. fzf-lua is a great modern fzf.vim alternative I believe.

I can accept criticisms and questions around why telescope is slower than just using fzf directly, but I don't appreciate repeat suggestions hinting that it'd be easy to replace our "search engine" with fzf - I don't think you even understand what you're talking about.

If I'm wrong and you do know what you're talking about and you're correct in thinking that's it's easy to massively improve the performance of telescope while keeping feature parity - you're free to fork it and implement it yourself. In fact, I would very much be interested in this.