One simple shortcut for displaying a list of these shortcuts is
- Ctrl + Shift + L => Show Key Assist
Here is a list of some of the most useful Eclipse shortcuts I use:
Disclaimer: my shortcuts are very Java(JDT)/Plug-in(PDE) focused. Similar shortcuts are probably available in CDT or other packages, especially given the ongoing work to provide JDT-like functionality via projects such as the DLTK.
Common
There is something to be said for de facto shortcuts which work across all types of programs. Eclipse does a good job in this respect by implementing some shortcuts that are common to many programs. Such shortcuts include
- [update: I thought Ctrl+Tab was used to tab through the open editors, but I see now the default for this command is Ctrl+F6. Another command I would find useful is a next tab command for navigating the bottom tabs found in editors such as the Plug-in Manifest Editor.]
- Ctrl + W => Close Tab
- Ctrl + N => New (Other...)
One of the tasks which led to my constant use of the mouse in Eclipse was the simple navigation between views/perspectives/editors/etc. While each of these tasks has its own set of commands (Alt+Shift+Q was particularly useful for me to open/navigate to different views), I recently discovered the master of all shortcuts
- Ctrl + 3 => Quick Access
Most people I know are familiar with some common navigation shortcuts such as
- F3 => Open Declaration
- F2 => Open Tooltip
Eclipse provides some useful views for navigation, including the type hierarchy and outline views, but instead of letting these views clog your precious screen real-estate, you can use their quick command options instead:
- Ctrl + O => Quick Outline (x2 to toggle show/hide inherited members)
- Ctrl + T => Type Hierarchy (x2 to toggle between supertype/subtype hierarchies)
- Ctrl + H => Search
- Ctrl + G => Declarations in Workspace
- Ctrl + Shift + G => References in Workspace
- Ctrl + Alt + H => Call Hierarchy
- Ctrl + Shift + R => Open Resource
- Ctrl + Shift + T => open type
- Ctrl + Shift + A => open plug-in artifact*
Eclipse also provides some useful commands for use while programming. Perhaps the best know example would be the content assist (Ctrl+Space) feature. This binding will also rotate through a list of (customizable) templates/proposals if you press it more than once.
Another prevalent shortcut is the quick fix. This command seems to get better with each version of eclipse (especially for OSGi-related issues). I also use the lesser know quick assist command for assigning statements to fields (Ctrl+2, F) and local variables (Ctrl+2, L).
- Ctrl + 1 => Quick Fix
- Ctrl + 2 => Quick Assist (Assign To)
- Ctrl + Shift + F => format
Eclipse is also chock full of refactoring/source assistance. Although each of these menus is available via shortcut (Alt+Shift+T and Alt+Shift+S), my favorite refactoring shortcuts are:
- Alt + Shift + R => Rename
- Alt + Shift + Z => Surround With
- Alt + Shift + M => Extract Method
Run/Debug
Finally I would be remiss to list my favorite run/debug shortcuts, though I think these are fairly self-explanatory:
- F11 => Run
- Ctrl + F11 => Debug
- F5 => Step Into
- F6 => Step Over
- F7 => Step Return
- F8 => Resume
- Ctrl + R => Run to Line
- Ctrl + click => Step Into Method
- Ctrl + F2 => Terminate
Conclusion
The combination of key bindings and filtering text boxes is awesomely powerful.
Learning to use Alt, Ctrl, and Shift on both sides of keyboard is vital (maybe its just me, but I previously used my left hand for all these keys...proving problematic for bindings like Alt+Shift+R).
In general, I am not a big fan of Fx (x=1-12) shortcuts as I find them awkward to type (though I do use them and have even listed a few).
Here is a slightly condensed list of the most useful bindings I've seen people miss:
- Ctrl + Shift + L (x2) => Key Bindings Preferences
- Ctrl + 3 => Quick Access List
- Ctrl + O => Quick Outline (x2 to toggle show/hide inherited members)
- Ctrl + T => Type Hierarchy (x2 to toggle between supertype/subtype hierarchies)
- Ctrl + H => Search (File Search)
- Ctrl + G => Declarations in Workspace
- Ctrl + Shift + G => References in Workspace
- Ctrl + Alt + H => Call Hierarchy
- Ctrl + Shift + R => Open Resource
- Ctrl + Shift + T => Open Type
- Ctrl + Shift + F => Format
- Alt + Shift + F1 => Plug-in Spy
- Alt + Shift + R => Rename
- F11 => Run
- Ctrl + F11 => Debug
- Ctrl + R => Run to Line
*new in Ganymede
2 comments:
Ctrl + M has quickly become one of my favorites. This shortcut maximizes/restores the current view. If you learn to navigate views via keyboard, this shortcut is a real time-saver.
I like this list
http://shortcut-finder.appspot.com/shortcuts.jsp?query=eclipse
Post a Comment