Saturday, April 12, 2008

Eclipse Shortcuts: or To Eclipse and Back Again

Recently I shifted from coding in VisualStudio+ReSharper to coding in Eclipse. Again. And me being very much a keyboard shortcuts person, I needed to find Eclipse equivalents for all my favourite ReSharper shortcuts. Déjà bloody vu. So I decided I'll spend some time and record the Eclipse versions of my oft used shortcuts for the next time. Here they are:

Most Used
Ctl+Space : completion
Ctl+1 : Quick fix suggestions
F2 : Show tooltip (javadoc, help)
Navigate
F3  : Go to declaration
Ctl+Sh+T : Open type (class)
Ctl+Sh+R : Open resource (file)
Ctl+O : list class members
Ctl+. : Next error/warning/search result
Ctl+E : switch to an open file
Alt+Left : Previous cursor location
Alt+Right : Next cursor location
Ctl+Q : Last edit location
F12 : activate editor
Ctl+M : maximise or restore active view
Ctl+J : Incremental search
Ctl+Sh+J : Incremental search backwards
Ctl+Sh+G : Find references in workspace
Ctl+Alt+H : Open call hierarchy
Alt+Sh+Q,S : open search view
Ctl+F7 : cycle through views
Alt+Sh+Q,P : package explorer
Debug
Alt+Sh+D : Debug menu
Ctl+Sh+B : toggle breakpoint
Ctl+Sh+I : inspect
F5 : Step into
F6 : Step over
F7 : Step out
F8 : Resume
Launch
Alt+Sh+X, T : Run tests
Ctl+F11 : Run last launched
Refactor

Alt+Sh+T : Refactoring Menu
Alt+Sh+M : Extract Method
Alt+Sh+R : Rename
Alt+Sh+C : Change method signature
Alt+Sh+I : Inline variable/method
Alt+Sh+L : Extract local variable
Alt+Sh+V : Move
Code
Ctl+Sh+F : Format
Ctl+Sh+O : get rid of redundant import statements
Alt+Sh+Up : select enclosing element/widen selection
Alt+Sh+Down : narrow selection
Alt+Sh+S : Source menu (override, create constructor,...)
Alt+Sh+Z : Surround with menu (try/catch, for,...)
Alt+/ : word completion
Ctl+Alt+Up : duplicate line

One of these days I should make this list for ReSharper and IDEA as well.

In the meanwhile, if there are any of your favourites I've missed, do let me know.