One of the biggest differentiators between the users who prefer IntelliJ over Eclipse is often their dedication to learning keyboard shortcuts. The user-conscious designers of IntelliJ make as much as they can consistent, something much more difficult for Eclipse, who is dependent on a community for plugin development without any process for reviewing how well they all fit together.
On my very first ThoughtWorks project, I remember my pair commenting about how I should learn all the keyboard shortcuts for IntelliJ. Learning keyboard shortcuts is less about churning out great amounts of code, and much more about avoiding interrupting your flow. Simple actions, such as reaching for mouse have potential to break your flow. Jetbrains make it easy to learn the keyboard shortcuts, even providing a printable cheat sheet so you can put them around your workspace as you learn them.
Having said all of this, here are some of the keyboard shortcuts I find myself using all the time for iPhone development:
- Switch to Header/Source File– ALT + CMD + UpArrow
- Open quickly – Shift + CMD + D. This is as close to Jump to Class/Method/Symbol that I could find so far. I haven’t worked out how to search using regular expressions yet.
- Go back/forward – ALT + CMD + LeftArrow/RightArrow. Moves back between files that you opened. Useful for cycling through a call stack
- Go(Run) – CMD + Enter. I’m currently using this to quickly see results as a spike my way through learning about Objective C and the APIs
- Open Console – SHIFT + CMD + R. Useful when debugging using log statements and looking at what’s going on.
I’ve also found application-wide standard keyboard shortcuts really helpful as well
- Cycle through different applications (XCode, Interface Builder) – CMD + TAB
- Cycle through different windows in the same application – CMD + ` or CMD + ~. These are all really useful because Apple applications have a tendency to open many many windows, not really ideal for keyboard use.
- Open help – SHIFT + CMD + ?. This is really useful when no keyboard shortcut is mapped, or you want to access a menu and can’t remember what it was. Once you have the Help dialogue open, start typing the name of the menu item. I’ve used this quite a lot to access the Refactor menu item which pops open another window.
Of course there are many more keyboard shortcuts. These are simply the ones that I’ve found I’m getting the most productivity. I wouldn’t say all of development can driven through the keyboard alone, but it’s a pretty good start for now. What are your favourite ones?