Chapter II: Getting comfortable with IDEA’s Keymap, Navigation and Settings
Get ready to make a list! In this chapter, we go over in detail all the shortcuts you’ll need to effectively get started with IDEA, and highlight the major differences that might befuddle Eclipse users at first…also, we have a couple cheatsheets for you. Just click on each image below to enlarge and print!
Key bindings is something that gets welded into the backbone of developers—this is probably one of the hardest parts about migrating to one IDE from another. The most painful thing is when you hit a shortcut that performs a completely different (and often harmful) action than what you expect. If you are Eclipse user, try hitting Ctrl+D / Cmd+D in IntelliJ IDEA: you will realize the issue immediately!
Of course, you can change the bindings of your keymap in IDEA. This is as simple as pressing Ctrl+` and selecting a preferred keymap. You can select between Eclipse, NetBeans, Emacs key bindings and some more.
Even though you can change the key bindings to the ones from the IDE that you’re familiar with, it doesn’t seem to be a good idea.
“What I screwed up when trying IntelliJ IDEA is that I changed to Eclipse shortcuts and then I didn’t know what the key for Alt+Enter is.”
ERKKI LINDPERE – Typist
“I went over keymap and assigned the most wired key-bindings from my Eclipse days. Especially if they didn’t collide with anything important.”
OLEG SHELAJEV – Software Developer
As we figured, the best strategy is to stick with the default key bindings and only change those handful of shortcuts that are really welded into your muscle memory and you can’t help yourself but hitting the wrong keys.
There are many shortcuts in IntelliJ IDEA, for navigation, editing, refactoring and more. In the following section, we’ll go over the most important key bindings that you most likely will need.
Before we proceed to the main part, let’s bring up the shortcuts that cause the most annoyance to ex-Eclipse users.
Ctrl+W / Cmd+W
One single shortcut that probably annoys Eclipse users the most is the block selection shortcut. Ctrl+W / Cmd+W is used to gradually expand the selection of code.
“I wish Ctrl+W did what I expect it to do :(“
ADAM KOBLENTZ – Senior Pre-Sales Engineer
“We also are now trying to promote OSX 10.5+ keyboard binding on OSX to make OSX users feel more at home.”
HADI HARIRI – Software Developer
Yeah, indeed, Ctrl+W is usually used to close a tab or a window of an application. And IDEA decided to reserve this shortcut for something else: code selection.
But hey! The reason you want to use Ctrl+W / Cmd+W is actually irrelevant if you learn the zen of not closing the tabs — we’ll cover that in the Dealing with Tabs part later. If you develop a habit when you don’t have to close the tabs, you can then use Ctrl+W / Cmd+W for something else, i.e. for code selection.
Ctrl+D / Cmd+D
This is, arguably, the second most-annoying shortcut. In Eclipse, this shortcut is used for deleting the line. In IntelliJ IDEA, ‘D’ stands for ‘duplicate’. To delete a line, use Ctrl+Y / Cmd+Y instead.
Ctrl+S / Cmd+S
“You should be aware of the auto-save feature and know what are you doing to enjoy it. For example, our small Play 1 application tries to reload everything when IDEA saves file (because it works on the source code level). In the same way I suspect any interpreted language behaviour somewhat cripples the usefulness of autosave.”
OLEG SHELAJEV – Software Developer
You do not have to save changes in IDEA: autosave works incredibly well. Just forget about saving the files as if it is a bad habit. Stop. Hitting. Ctrl+S.
Download the PDF