The keyboard is your friend
Over the past four years I’ve spent a lot of time using Eclipse for Java development. I used to use JBuilder but thankfully I’ve managed to overcome that episode of mental torture with no lasting problems.
I’d go as far as to say I know Eclipse better than the back of my hand (which, now I think about it, I don’t know that well at all). It takes a lot of mouse clicks to do some basic things in Eclipse, so learning its keyboard shortcuts is one of the most productive things you can do.
So, for your coding pleasure, and in most-useful-first order, here are the ones I use most often on Windows*:
| Save | Ctrl-S |
| Context-assist | Ctrl-Space |
| Open Declaration | F3 |
| Delete current line in active editor | Ctrl-D |
| Find/Replace | Ctrl-F |
| Find next occurance of selected text | Ctrl-K |
| Comment/uncomment selected line using // | Ctrl-/ |
| Open Type (class, interface, enum etc) | Ctrl-Shift-T |
| Show Type Hierarchy | Ctrl-T |
| Display drop-down list of editor windows | Ctrl-E |
| Rename in file | Ctrl-2, R |
| Rename Type | Alt-Shift-R |
| Open Resource (xml, csv etc) | Ctrl-Shift-R |
| Organise Imports | Ctrl-Shift-O |
| Show Class Outline | Ctrl-O |
| Close Active Window | Ctrl-W |
| Format | Ctrl-Shift-F |
| New | Ctrl-N |
| Maximize/minimize active window | Ctrl-M |
| Show quick fix | Ctrl-1 |
| Switch View | Ctrl-F7 |
| Switch Perspective | Ctrl-F8 |
| Go To Line | Ctrl-L |
| Activate Editor | F12 |
| Select All in active editor | Ctrl-A |
| Comment selected line using /* comments | Ctrl-Shift-/ |
| Display all this (and then some) in Eclipse! | Ctrl-Shift-L |
One other thing. By default, Eclipse uses Ctrl-F6 (and Ctrl-Shift-F6) to switch between editor windows. I don’t know about you, but I don’t have E.T. fingers so I find this hard to do with one hand. Instead, I always modify the mapping (Window / Preferences… / General / Keys - sheesh!) to Ctrl-Tab.
If you’re keen, feel free to download a handy PDF to print out and stick on your monitor.
- *Coming up next, OS X…
Posted by Olly on May 31, 2006 at 7:07 pm in java
| Permalink

What’s the keyboard shortcut to launch Vim?
:-Ctrl-Shift-G-Esc-i-//-*-()
Probably
;-)