Comments (14)
@Shougo
can you please provide example how to ignore and prevent scanning large directories like 'node_modules' ?
from denite.nvim.
@legendar: it has to be done in the command
. See the example in :help denite
which uses ag as a command. ag
ignores .gitignore
ed 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.
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.
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.
hi, @lambdalisue, could you show your solutions after this discussion?
from denite.nvim.
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.
Workaround: specify patterns to be ignored in wildignore
from denite.nvim.
@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.
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.
I dont understand how your example helps ignore files.
from denite.nvim.
@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 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.
Oh. What I meant was close comments, to prevent further distraction
from denite.nvim.
OK
from denite.nvim.
Related Issues (20)
- vim-clapを用いたfile/rec検索をするとエラー HOT 1
- Custom action doesn't work with choose_action HOT 2
- File source throws PermissionError if an unreadable file/directory in candidates HOT 12
- Filter of file source doesn't work properly, but file/rec works HOT 1
- 直近の仕様変更について質問と要望 HOT 2
- Backspace moves from filter to denite buffer window HOT 1
- vim-clapの更新でエラー HOT 1
- Change of behaviour of <Plug>(denite_filter_quit) HOT 4
- Do not working in windows10(python3.9.2) HOT 2
- High-match items are no longer prioritized HOT 2
- Floating window HOT 6
- Denite with floating window fails HOT 3
- Feature Request: open any path from user provided list HOT 1
- :Denite with `-start-filter` removes some input characters HOT 2
- [Question] At denite-filter, the completion is displayed. HOT 6
- -filter-split-direction=floating is broken when cmdheight=2
- denite menuでdeniteのコマンドを実行するとエラーが発生する HOT 1
- Unexpected -immediately-1 behaviour HOT 4
- raised ValueError in open file HOT 1
- python and n/vim use high CPU time after denite usage. HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from denite.nvim.