cobby
cobby

Reputation: 498

How to search only through selected files/folders in IntelliJ?

I'm coming from eclipse and one of my most used feature is to select fiels/folders in the navigator and then execute a search on those (clicking Ctrl+H => only the selected files/folders are searched recursivly).
Pressing Ctrl+Shift+F in IntelliJ only selects the parent folder or the first folder.
How can I search through my selection in IntelliJ?

Upvotes: 1

Views: 854

Answers (2)

Martin
Martin

Reputation: 441

Thanks to @Egor Klepikov for the initial answer.

To make the option "Selected files" work, you need to first select the files you wish to search in via the project window (with ctrl+click) as shown below:

Select files in project window

Afterwards, open "Find in Files" (shortcut: ctrl+shift+f) and choose "scope" and then in the drop down menu "Selected files" as shown:

Choose option in Window

Alternative

Another option is to open the files in which you want to search and then select "Open files"

Choose another option

Upvotes: 0

Egor Klepikov
Egor Klepikov

Reputation: 5809

You can switch to the Scope tab and select Selected directories/Selected files from the list. E.g., enter image description here

Here is a related request https://youtrack.jetbrains.com/issue/IDEA-92340 to make this feature work better. Feel free to upvote/comment.

Upvotes: 3

Related Questions