Top 10 IntelliJ Shortcuts

Learning IntelliJ (or other IDE) shortcuts can make us more productive developers. In this post, I’ll highlight my top 10 IntelliJ shortcuts, which I found using the productivity guide:

Go to ‘Help’ > ‘Productivity Guide’ in IntelliJ

10. File Structure Popup

⌘F12 or Ctrl + F12

Shows you the structure of a class with methods and properties – handy when looking at a large class. Also, you can search by typing in the popup.

9. Go to implementation(s)

⌥⌘B or Ctrl + Alt + B

Go to the implementation of the method or property under the cursor. Equivalent of holding ⌘ or Ctrl + clicking using a mouse.

8. Comment / uncomment with line comment

⌘/ or Ctrl + /

Comment out a whole line or selected block.

7. Extract variable

⌥⌘V or Ctrl + Alt + V

Create a variable from a highlighted snippet automatically. This is useful when creating a new variable too:

Using ‘Extract variable’ to create a new variable

6. Recent files popup

⌘E or Ctrl + E

Shows the files you’ve recently worked on.

5. Complete statement

⇧⌘⏎ or Ctrl + Shift + Enter

My favourite shortcut! Start typing and IntelliJ will try to complete the structure around you. For example, if you’re typing an ‘if’ statement, you can easily add the surrounding braces:

Using ‘Complete Statement’ on an ‘if’ statement

4. Delete whole line


Rather than deleting individual characters, this is useful if you want to get rid of the whole line.

3. Search Everywhere

Double ⇧ or Double Shift

A good place to start when looking for a class name, a method name, an action or even a setting.

2. Rename

⇧F6 or Shift + F6

As developers, we want our code to be as readable as possible. That means deciding a variable name can take a few attempts. This shortcut makes it easy.

1. Extend / Shrink Selection

⌥↑ / ⌥↓ or Ctrl + W / Ctrl + Shift + W

This is so handy, it should be part of the OS for any text selection:

Bonus – Find Action

⌘⇧A or Ctrl + Shift + A

Again, a really useful shortcut to find pretty much anything in the IDE – creating a new branch, stashing current changes etc.

For the more shortcuts, check out the Jetbrains official site.