Categories
Development

Eclipse key bindings

First thing first … Eclipse key shortcuts setup. You can not work with Eclipse effectively unless you know and use them. So To remap/investigate key bindings go to Window > Preferences > General > Keys. Remember, you need to first click unbind command before setting new key!! Otherwise your changes will be ignored. If there is a conflict, it will be shown in Conflict window. So here is my essential list of shortcuts:

Ctrl + tab to switch between last used tabs/files.
Eclipse by default uses strange shortcut for next and previous tab: CTRL-F6 /SHIFT-CTRL-F6. You need to remap those keybindings to CTRL-TAB / SHIFT-CTRL-TAB every time you create a new workspace.
In the filter field, type “next ed” and “previous ed” to find the right bindings.

ALT + arrow left, arrow right
Go to previous / next cursor position. Jumps also between files.

Ctrl + Shift + F
Format code

Ctrl + Shift + E
Switch to editor – show list of opened files with paths

Ctrl + Shift + T
Find class by name / package

Ctrl + Shift + G
Find references in workspace – remap it to Ctrl + Shift + Q so it is closer. Remove the quick diff which is mapped to this command.

Ctrl + mouse hover over method
Select from popup – Open Implementation – enables you to jump from interface call to a specific implementation

Ctrl + /
toggle comment

Ctrl + Shift + /
add block comment to selection (works also in XML)

Ctrl + Shift + \
remove block comment from selection

Ctrl +1
Quick fix. Shows menu with suggestions about how to fix current error / warning.

Ctrl + Shift + O
Fix and organize imports.

Ctrl + Space
And of course the all time favourite shortcut for code autocomplete.