search.exclude config for IDEA
Answered
Hey, VSCode supports search.exclude configuration in settings.json file. Something like this:
// Configure glob patterns for excluding files and folders in fulltext searches and quick open. Inherits all glob patterns from the `files.exclude` setting.
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/*.code-search": true
},
Is there an alternative for IDEA? I would like to add this config to .idea folder and push to git.
Please sign in to leave a comment.
In IntelliJ IDEA you can exclude files/folders of your modules under File | Project Structure | Modules | module_name | Sources. Select the directory you need to exclude and press on Excluded button:
also, you can exclude specific files only by specifying the file pattern in Exclude files field.
These changes are stored inside .iml files of your modules.
In addition, you can create custom search scopes as per https://www.jetbrains.com/help/idea/settings-scopes.html .
Very cool. In my case .iml file is located under .idea directory. What is the right place for it?
By default .iml file is stored inside the root directory of your module. If you need to keep it inside the .idea directory please make sure that all references are updated. See the related discussion https://intellij-support.jetbrains.com/hc/en-us/community/posts/206854115-Move-iml-files-to-other-directories-
Creating and managing scopes (and remembering to select scope with every search) is just cumbersome.
I really wish there was a simple option to exclude files in the Project window, the same way I can exclude directories.
One more idea: how about a “managed by git” scope?
I'm happy with searching only git-managed files (as I define `.gitignore` anyway, so it would be just easier not to double the work with the extra IDE configuration).
Hi Dawid Nowak , feel free to create a feature request at https://youtrack.jetbrains.com/newIssue?project=IDEA , then paste the issue link here, and I will help you process the issue.
See this article if you are not familiar with YouTrack.