my favorite eclipse shortcuts for code browsing

‘you have to have a set of tools, which you should use without any breakdowns’ i once read a sentence in the manner of the above in ‘The Pragmatic Programmer’.

for most developers eclipse is such a tool, so for me. here are some of my favorite shortcuts which helped me to keep my fingers on the keyboard when browsing through the code …

ctrl + shift + t
search for (java) types
you can enter only the uppercase letters of your wanted class or interface. eclipse will bring only such types to the top which contains these uppercase letters inside their names.
i.e. entering BAD finds BankAccountDAO or BaseAssertionDummy

ctrl + shift + r
searches for any resources .
the same is true for search with uppercase letters as mentioned above. beside types, eclipse will list any other resources, i.e. jsp, xml, properties, …

ctr + o
searches for a method inside a type. let you jump quickly to the beginning of a method.

F3
opens the declaration of a type. let you jump quickly from a type to another type. just place the cursor to the declared type you want to jump to and hit F3. you can alternatively push ctrl and click onto the type you want to open.

alt + arrow left / rigth
lets you jump right back (and forth) to the location (i.e. type declaration) you came from.

ctrl + t
shows the type hierarchy of a type. just place the cursor to the declared type with the wanted hierarchy and hit ctrl + t. now you can scroll through the hierarchy (arrow up / down) and open the desired supertype or subtype (by hitting enter).

ctrl + shift + g
searches for all references of a type or method. just place the cursor the the declaration of the type or method and hit ctrl + shift + g. now you have an overview of all types in workspace which references your class / method.

Advertisements

4 Responses to “my favorite eclipse shortcuts for code browsing”

  1. WurstFromHell Says:

    Hi,
    cool site. Thanks for posting those hints. The article about RegExs look promising.

    Greetings from the Hanauer Landstrasse,
    WurstFromHell

  2. WurstFromHell Says:

    Other useful shortcuts:

    Ctrl+(shift+)k
    -> Searching forward (backward) for the last highlighted text

    Ctrl+. -> Go to the next warning / error
    Ctrl+, -> Go to the previous warning / error
    * works in Javaperspective, not e.g. in phpeclipse

    Ctrl+shift+l -> List of many available Shortcuts

  3. Mario Gleichmann Says:

    Hi WurstFromHell,

    thanks for your comments and your additional shortcuts – appreciate it :o)
    maybe there should be also a list of favorite shortcuts for other tasks than code browsing, i.e. debugging, editing and so on. future will show … :o)

  4. claudio Says:

    ctrl + 3, meta-short-cut 🙂


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: