Navigate Quickly

Whenever you are working on a project consisting of multiple modules you may want to navigate through it as quickly as you would with a single level one.

From my personal observations the most used IntelliJ Idea’s feature among people crawling their codebases using a mouse is finding a class by its name:

It’s also possible to search for a folder by putting a / symbol:

The later one is invaluable working on a project with a structure as:

Notice, two modules domain and functional-tests both have java directory. Instead of scrolling miles using a mouse looking for a folder you need you could leverage the search for a directory feature. There is more to it — you do not have to type all these long names, it is enough to only use first characters, that is, let’s say you can’t wait navigating to java folder which is located in domain module. All you have to type is:

  • d which corresponds to ‘domain’
  • / to indicate this is a directory
  • j/ which corresponds to ‘java’

You can see three of them as there are three different ‘java’ folders in the module, if you’d like to be a bit more precise you can specify the directory:

Using the exact same approach you can find java directory located in another module — functional-tests:

I could go on but you’ve got the idea.

Love to the mouse and happy searching.

Show your support

Clapping shows how much you appreciated Eugene Beletskiy’s story.