TV's Frank
TV's Frank

Reputation: 818

How to force IntelliJ to always search in "Whole Project"

I like to use the Find in Path function CTRL+SHIFT+F, that searches for text strings in several files.

One thing I often run into though, is that I search for something that I know exists in at least one file, I get zero results or I find just some of the files that contain the search term.

Then I realise that the Scope setting in the Find Dialog box has been set to Module or Directory for some reason rather that "Whole project" which is what I almost always want.

What fools me here is that this only seems to happen occasionally - often I'll have the scope set to Whole project like I want to, but sometimes it will be something else.

How does IntelliJ decide which scope to use?

Also, is there some setting that can be used to force IntelliJ to always select "Whole project" as the default?

Upvotes: 19

Views: 4318

Answers (2)

robinst
robinst

Reputation: 31467

Not really a solution, but how to avoid using the mouse for this:

When the dialog is open, press Alth before pressing enter. This will cause the scope to be set to Whole project.

Upvotes: 5

Mihai Toader
Mihai Toader

Reputation: 12253

Just collapse the project tab before: Command + 1 or Alt + 1

The default selection depends on the context which launched the search. If you have the project tab open with a folder/file selected it will search in that folder or the parent of that file.

To search by default just close that panel (this will make the context be the whole project) and press the search shortcut and it will be scope properly.

Upvotes: 8

Related Questions