Exclude folder from search but not from project list

I have several different projects with the same core .

All I need to do is mark all non-current projects as excluded to avoid searching for them (simple search, shift + cmd + n, etc.)

In other words, I want to get search results from core + current project .

Is there any way to close some projects, but they are available in the projects list and open as easily as they were closed? Or maybe you have a different experience?

enter image description here

+82
php webstorm phpstorm
May 15 '13 at 7:29
source share
4 answers

To apply a custom search, use Scopes Setting > Project Settings > Scopes to use it for Find in Path or Replace in Path .
I suggest reorganizing your folders so that there are no unnecessary files left in the project directory. Alternatively, you can specify Source Root by going to Settings > Project Settings > Directories and adding additional directories.

+58
Sep 22 '14 at 11:10
source share

Starting with version 2016.3 , it is under Settings > Appearance and Behavior > Areas .

Or regardless of version , just go to Settings and enter β€œareas” in the search box at the top.

Then simply click on the + symbol to add an area, select the folder you want to exclude, and click Exclude recursively and apply.

Then, when searching using CTRL + SHIFT + F, under Options> Region, select Custom and select the region you just created (thanks to the commenters).

+33
Dec 20 '16 at 1:56
source share

This is the best way to exclude directories from search results. I am working on a large Magento project with many directories that I don’t need in the search results. This solved my problem.

Right-click on any folder to open the following options.

Exclude from search

+26
Sep 27 '17 at 16:28
source share

As @Justinas and the commentators said: you can create your own scope and annoy yourself each time by choosing this area when using the Find on the Way (and similar) function, since PhpStorm does not use this area by default scope

The node_modules directory exception violates autocomplete and other code support functions anyway. You do not want to do this.

However, I found a hack that requires neither node_modules directory exclusion nor user scope:

  1. Close PhpStorm. Make sure it is not working.
  2. Open name_of_your_project.iml in the .idea directory in your project directory in your favorite text editor. This is not PhpStorm yet.
  3. Delete the line <content url="file://$MODULE_DIR$/node_modules"/>
  4. Save.
  5. Enjoy life again.

I find it interesting to include dependency storage directories in JetBrains, such as node_modules JavaScript / TypeScript and the default PHP provider. There are practically no options for using these directories in search and replace functionality, as well as in refactoring functionality.

0
Jul 03 '19 at 9:43
source share



All Articles