Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude file from PhpStorm global search (Ctrl+Shift+F)

I want to exclude a file from the PhpStorm global search (Ctrl+Shift+F) but not exclude the file from the project itself. A good use case would be to avoid searching inside files like jQuery.js, but in my particular case, I have a plugin that generates code and it clutters my search results.

Being specific, this is the example search result: search-results

The first result is uselss and will always be for me. So I would like to exclude it from the results. However, if I exclude it from the project then it will not be included in the auto-complete features of PhpStorm, which is the sole purpose of that file in the first place.

Or are there any alternatives to this? I could select a folder and search only there, but it is not as convenient as just pressing Ctrl+Shift+F directly from the editor

like image 270
santiago arizti Avatar asked Jan 13 '16 16:01

santiago arizti


2 Answers

You can do that defining a scope

First of all you have to define a scope containing all the directories of your project that you want to be "searchable".

Go to Appereance & Behaviour -> Scopes and create the scope

Then, in the "Find in Path" window you can select the Custom scope you want to use for the search

like image 91
Moppo Avatar answered Sep 24 '22 15:09

Moppo


Right-click on the folder > Mark directory as > Excluded

enter image description here

like image 20
Alexander Mikhalchenko Avatar answered Sep 24 '22 15:09

Alexander Mikhalchenko