New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude folder in project root (only) #1115
Comments
You may can exclude with "/node_modules/**" |
The example that you game doesn't work for me. Does it work for you? To which setting are you adding the pattern? I'm trying to exclude from project root, not filesystem root. |
OK, I understand can I ask whats the goal? Hide from sidebar or exclude from search and indexes? |
Exclude from search and indexes. It works but it excludes all node_modules inside the projects, not only the one in the root. |
OK, the bug as is, is still valid in my opinion. As a workaround, In that case, is much better to mark as binary (excludes from search and indexes) with the binary_file_patterns but still shows in sidebar. However you will need a package https://github.com/titoBouzout/FindResultsApplyChanges that populates the exclusion list automatically when searching folders(but also avoids to populate exclusion for the right clicked folder/s), so someone asked for something very similar to what you want to do here, and here is the explanation with the use case https://github.com/titoBouzout/FindResultsApplyChanges/issues/12 |
Thanks, didn't know that package. The only drawback of it is Now the workaround of adding each module individually works but is cumbersome. Currently using a symlink with other name so that sublime catches all the contents of the folder: |
about double click
about
That's not the idea, the idea is to completely skip node_modules using node_modules/** and then just right click the folder on sidebar when you need to search for something there. You can select many folder at the same time, and these folder will not be exclude because you explicitly are selecting these. |
ah, good point. my main use case is not with search though, but with goto everything. also the modules I'm referring to are just normal part of my code, except they are included using browserify. |
I see okei =) well.. workaround for the other issue.. about git, you may be able to symlink from outside of your project, and then just drag the folder (you will have at least two folders in the project) |
its more about when other people clone the project and so on, some extra steps necessary to setup the symlink, but thanks for the suggestion. Just so its clear this issue is still open. |
You can exclude the folder using the folder_exclude_patterns in project settings {
"folders" :
[
{
"path" : "/path/to/your/project",
"folder_exclude_patterns" : [ "project/node_modules" ]
}
]
} This will remove the node_modules folder from the root of your project but will not remove it from other nested directories |
@maxgaurav thank you. The problem here is that for this to work, a different path needs to be defined for each project. This request is about a global configuration which you don't need to set for each project. Furthermore this configuration would break when the project is cloned to a different computer. |
What is the status of this? I'm giving it +1. I want to exclude Another solution would be to introduce some project path variable to be used inside the pattern, but I'm not too excited about that. |
Relative paths would be great, of course.
|
It’s not a workaround, what if the folder is in the root? |
I mean, setting (corrected previous comment to indicate absolute url) |
That’s what I’m doing now, but it has zero portability. Would be great if Sublime had used another syntax for excluding. Using it just as a needle is faulty idea imho. |
As of build 4067, you can now use |
The objective is to be able to exclude
/myproject/node_modules
but not/myproject/src/node_modules
One way to achieve this is to specify the project root name in the exclude patern:
*myproject/node_modules*
. However it doesn't work for every project, because the name of the project changes.What is being requested is a way to match only folders in the project root, either via proper regex support, or by variable substitution ("$project_name/node_modules"), or simply with "/node_modules/*" which currently doesn't match anything).
People requesting something similar :
The text was updated successfully, but these errors were encountered: