Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

intellij how to find / search for a folder / directory / package name

I wish to search just directory (folder) names and packages within the modules of my current project.

How can I do this?

CTRL+Shift+N allows me to find a class

CTRL+Shift+Alt+N allows me to find a symbol

Is there a function for that allows me to search just directories, folders and package names?

I'd like the result of this search to be that the directory / package sought is highlighted in the "Project" box:

For example if I type in "model.feed" then then I get this:

Intellij Proejct Packages Box View

and preferrably while I'm typing that a list of any directories matching would be shown in real time (in the same way as classes are when you do "CTRL Shift N")

I'm using Intellij 12.0.4 (Ultimate)

like image 617
Simon B Avatar asked Jun 16 '13 09:06

Simon B


People also ask

How do I search for resources in IntelliJ?

From the main menu, select Edit | Find | Find in Files Ctrl+Shift+F . In the search field, type your search string. Alternatively, in the editor, highlight the string you want to find and press Ctrl+Shift+F . IntelliJ IDEA places the highlighted string into the search field.

How do I use global search in IntelliJ?

IntelliJ is project based so you can only search within the open project using Ctrl + Shift + F (Windows) or Cmd + Shift + F (Mac). "you can only search within the open project" -->That's not right as of today. You are also able to search through you a folder using Ctrl + Shift + F.


2 Answers

In IntelliJ IDEA 13, you can use Goto File (Ctrl+Shift+N) and enter the directory/package name with a slash afterwards. Then you'll see all the matching directories in your project.

like image 72
Peter Gromov Avatar answered Sep 28 '22 11:09

Peter Gromov


I propose this as a partial solution to your query.

The following steps will allow you to find a file or directory or package name or jar name that is visible in the project view.

Caveats stated explicitly below, but give this a go.

  1. Click on the root folder in the Project View.
  2. Start typing words that you want to search on to find packages/files/folders/jars in the project view
  3. A tool tip will appear that contains the text Search For: along with the text that you have entered.
  4. The Project View will then highlight the first folder or file that matches the text that you have entered.

This may be close to what you are looking for.

The only caveat is that this search is constrained to those entities currently visible in the Project View so if you want to search a particular part of the project it appears that you have to expand those folder within the Project View. (From my testing of this in IntelliJ Ultimate Version 11.)

One way to work around this is to go to the root element in your project. Perform a partial traversal of where you want to go then by pressing enter you open the folder that you have landed on and then that search is completed.

Starting typing text again after pressing Enter will recommence the search from the current item in the Project View.

So by experimenting with this feature you can interactively walk around your project in the Project View in a dialog-box-free manner.

As a side note you can use the letters Camel Case style to traverse and find classes in the ProjectView

like image 29
Rob Kielty Avatar answered Sep 28 '22 11:09

Rob Kielty