Code Monkey home page Code Monkey logo

Comments (14)

legendar avatar legendar commented on August 24, 2024 2

@Shougo
can you please provide example how to ignore and prevent scanning large directories like 'node_modules' ?

from denite.nvim.

ohcibi avatar ohcibi commented on August 24, 2024 1

@legendar: it has to be done in the command. See the example in :help denite which uses ag as a command. ag ignores .gitignoreed files and if node_modules is ignored it's blazingly fast. So the bottomline is: use a command that ignores those directories.

Due to restrictions of the command customizing implementation and the special format of the find syntax it is currently not possible to use find properly to ignore directories but I'll make a pr that addresses this next week.

from denite.nvim.

Shougo avatar Shougo commented on August 24, 2024

This is not bug.
matcher_ignore_files just ignore globbed files.
So globbed candidates are already generated by file_rec source.
You must filter in file_rec source in the large directory.
ag can ignore .gitignore files and you can add the more directories.

from denite.nvim.

Shougo avatar Shougo commented on August 24, 2024

It should be possible to completely ignore some globs as it is possible with ctrl-p

Ctrlp uses glob(). It ignores 'wildignore' files automatically.
Ctrlp works. Because it has different implementation.

from denite.nvim.

tmdlzp avatar tmdlzp commented on August 24, 2024

hi, @lambdalisue, could you show your solutions after this discussion?

from denite.nvim.

lambdalisue avatar lambdalisue commented on August 24, 2024

Hum? Why did you mention me?

Well, anyway, I'm standing on the Shougo's side. I don't think this is a bug on denite. What you need is read the documentation of denite and e.g. ag for proper options.

Additionally, I don't use file_rec often. Usually I use my plugin to list and filter files tracked by git. If you interested, gina.vim + lista.nvim combination is what I rely on but don't ask me how to use these in this issue while this issue is for denite.nvim 😄

from denite.nvim.

nadya-p avatar nadya-p commented on August 24, 2024

Workaround: specify patterns to be ignored in wildignore

from denite.nvim.

nickmcdonnough avatar nickmcdonnough commented on August 24, 2024

@nadya-p can you provide an example? This is what i have:

set wildignore+=**/bower_components/**,**/node_modules/**,**vendor/bundle**,**target/scala**,**project/target**,*.jpg,*.gif,*.png,*.svg,*.zip

Yet I keep seeing files from node_modules appear in my file_rec results.

from denite.nvim.

Shougo avatar Shougo commented on August 24, 2024

@nickmcdonnough

file_rec does not ignore wildignore by default.
You must specify scantree.py like this.

call denite#custom#var('file/rec', 'command', ['scantree.py'])

from denite.nvim.

nickmcdonnough avatar nickmcdonnough commented on August 24, 2024

I dont understand how your example helps ignore files.

from denite.nvim.

ohcibi avatar ohcibi commented on August 24, 2024

@nickmcdonnough Read the other comments. The point is that the command itself needs to ignore the files whatever that might look like for the specific command. So if the command that ignores the specific files would look like e.g. scantree.py --flag-that-tells-scan-tree-which-patterns-to-ignore=node_modules,bower_components,tmp,log the example should read

call denite#custom#var('file/rec', 'command', ['scantree.py', '--flag-that-tells-scan-tree-which-patterns-to-ignore=node_modules,bower_components,tmp,log'])

It is possible to ignore results with denite; however that is not very performant in large directories as your subcommand would still return the entire list of matches.

It is not the point of denite to filter the lists it's subcommands generate in the best performant ways. The point is to provide a generic way to generate lists with whatever tools and then augment those lists with specific actions for each item in the list (e.g. list of all files matching a specific pattern inside the current directory and open each file in a new buffer when hitting enter) . By having a generic API for generating those lists one can use the power and knowledge of well established command line tools like find, ack-grep, ag, git, etc. which are the best what you can get for the specific tasks they solve. Therefore stuff like filtering the lists is best done with those tools itself as its impossible to defeat their performance from inside vim (except by simply calling them directly). If one wants a ctrlp like file opener that does all that in a performant way from inside vim with by default respecting wildignore, one needs to use a different plugin like ctrlp itself.

@Shougo the issue I originally opened was due to my misunderstanding and is thoroughly solved by yours and mine explanations. Close it (I would but I can't)?

from denite.nvim.

Shougo avatar Shougo commented on August 24, 2024

@Shougo the issue I originally opened was due to my misunderstanding and is thoroughly solved by yours and mine explanations. Close it (I would but I can't)?

The issue is already closed.

from denite.nvim.

ohcibi avatar ohcibi commented on August 24, 2024

Oh. What I meant was close comments, to prevent further distraction

from denite.nvim.

Shougo avatar Shougo commented on August 24, 2024

OK

from denite.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.