edit upload recent print


* WikiDocs

Main » EclipseShortcuts

Eclipse Shortcuts

This is a list of shortcuts (and their menu-locations) that are particularly useful in Eclipse.

For Mac users, note that if you want to use the function keys, you need to change the default key mappings for Expose' (in System Preferences) which use, by default, several of the mappings that Eclipse also uses by default. Similarly, Spotlight & Quicksilver often default to using the 'apple-space' combination which Eclipse uses for text-completion (a very useful feature), so you'll want to remap one or the other...

To map (or remap) keys in Eclipse, go to 'Preferences->Keys->Modify'.

See also: disable 'Generics' warnings in Eclipse

  • Ctrl+Space: Provides a drop-down menu of possible completions for what you're typing; select an option with the arrow keys, then 'enter' to insert it. Note that typing a '.' after the name of and object (for example) will bring up this same menu, containing possible methods, but this is not the onlt time you want to auto-complete. Probably the most-often used key-stroke for Eclipse users.
  • Ctrl-1: (Edit->Quick Fix) - Click on an error (red underline) and hit this key to get a list of possible fixes; select via the arrow-key, then 'enter' to make it so. Probably the 2nd most-used Eclipse shortcut.
  • F3: (Navigate->Open Declaration) - Go directly to the declaration of a variable, method or class.
  • F4: (Navigate->Open Type Hierarchy) - See all methods/variables for a class (as well as its inheritance tree) in a separate mini-window.
  • F5: (File->Refresh) - Refreshes package/explorer windows to reflect recent changes made through the file systems
  • F11: (Run->Debug Last Launched) - Runs the last launched program in the debugger. (Ctrl-F11 on the Mac)
  • Ctrl+F11: (Run->Run Last Launched) - Runs the last launched applet or application. (Ctrl-Shift-F11 on the Mac)
  • Ctrl-Shift-G (Search->References->Workspace) - Allows you to click on a variable or method and see a list of everywhere it is used.
  • Ctrl-Shft-O: (Source->Organize Imports) - Adds needed imports and removes unused/unnecessary ones.
  • Ctrl-Shft-F: (Source->Format) - Formats your code (indents, brackets, parens, etc) according to default Java templates, which you can modify to your taste in 'Preferences->Java->Code Style-Formatter'
  • Ctrl-Shft-/: Source->(Add Block Comment) - 'Intelligently' wraps the selected lines in a multi-line comment (/* ...*/)
  • Ctrl-Shft-\: Source->(Remove Block Comment) - Removes a multi-line comment (/* ...*/) from the selected lines

Instructor: Daniel C. Howe



Page last modified on March 13, 2010, at 05:55 PM EST