I have a few different project with the same core
.
All I need is to mark all not current projects as excluded
to avoid searching through them (
To apply custom search use Scopes Settings/Preferences
> Appearance & Behavior
> Scopes
to use it for Find in Path
or Replace in Path
.
I suggest to reorganize your folders, so that no unnecessary files are left in project directory. Also, you can specify Source Root by going to Settings
> Project Settings
> Directories
and adding additional directories.
Like @Justinas and commenters said: You could make a custom scope and annoy yourself every time by selecting that custom scope when using Find in Path (and similar) because PhpStorm does not use that custom scope by default
This is the best way to exclude directories from your search results. I work on large Magento project with many directories I don't want in search results. This solved my problem. If your project contains a /vendor directory, this will help speed up indexing in PHPStorm since it's ignored.
Right click on any folder to bring up the following options.
As of version 2016.3 this is found under Settings > Appearance & Behavior > Scopes.
Or regardless of the version, just go to Settings and type "scopes" into the search box at the top.
Then just click the + symbol to add the scope, choose the folder you want to exclude, and click Exclude Recursively and apply.
Then when you search using CTRL+SHIFT+F, under Options > Scope select Custom and choose the scope you just created (thanks commenters).