Do you know where ‘Go To…’ can get you?

How often do you use ‘Go To Class/File/Symbol’ feature in IntelliJ IDEA? Pretty often I would guess. But do you know everything you can do with it? Let me go through a couple of often overlooked gems.

Do you know that when you search for file or class you can preview an image (Ctrl-Shift-I) or see a quick doc (Ctrl-Q)?

It is also possible to open multiple items in the editor (multiselect with Ctrl or Shift) or run multiple selected tests right from the search (Ctrl-Shift-F10).

And you can open all search results in the ‘Find’ tool-window to process them one by one later.

Did I mention your favorite feature? No? Please, share it with everyone! :)

This entry was posted in Tips & Tricks and tagged , . Bookmark the permalink.

9 Responses to Do you know where ‘Go To…’ can get you?

  1. BenP says:

    My favourite use is simply Find Usages (Alt+F7) from a Go To Class dropdown. It means that you don’t need to open the class before looking for references.

  2. Bill says:

    I love reading these tips, but is there a manual somewhere explaining all of them? I feel like I’m getting a few intriguing tidbits from these blog posts, but how do I get the whole picture?

  3. Carsten Schlipf says:

    My favorite is that you can start with the first letters of the parts of a camel case type without completing the separated words. E.g. for finding ExtractClassTest you can type ExtClTe or even just ECT.

  4. BenP says:

    One enhancement to this feature would be to specify a line number. If I’m reading a stack trace from a log file, sometimes I want to go to MyClass line 90, I need to go to the class first, then Ctrl+G, type ’90′, enter. It’s a lot of keystrokes.

    I’ve often wondered why I can’t type Ctrl+N, MyClass:90, enter, which opens MyClass and positions the cursor at line 90.

  5. Alexander Doroshko says:

    @BenP you can do it using Go To File action (Ctrl+Shift+N)

  6. Philip Herbst says:

    @Alexander
    I often wondered why “go to line” doesn’t work with Ctrl+N?

  7. BenP says:

    @Alexander oh, you’re right.. How come it doesn’t work on Go To Class too?

  8. Alexander Doroshko says:

    @BenP Files have lines. Classes have fields, methods, etc., but no lines.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>