About Julen Pardo

Julen holds his Bachelor's Degree in Computer Engineering from Mondragon Unibertsitatea, in Spain. Currently he is working in Munich, Germany, as Software Engineer. He contributes to open source projects with plugins, and he also develops his own, open-source projects. Julen is continuously trying to learn and adopt Software Engineering principles and practices to build better, more secure, readable and maintainable software.

IntelliJ IDEA Keyboard Shortcuts Tutorial

The developers, systems administrators, etc., when dealing with files, have the need of being able to perform actions without depending on the mouse. Not only for speed and comfort, but also to avoid injuries related to the mouse usage, like RSI ones (Repetitive Strain Injury).

This tutorial will show the most useful shortcuts for IntelliJ IDEA, the JetBrains IDE for Java, Groovy, and other languages.

Depending, of course, on the indentation level, spaces before and after braces, etc.

Rename: Shift + F6

This is applicable to any identifier (class names, methods, attributes, variables, etc.). This is done “safely”, i.e., IntelliJ IDEA won’t break anything in the code.

Find & replace: Ctrl + R

This combination shows the typical tool window with two search boxes, one to find the term to replace, and another for the replacement. IntelliJ IDEA also allows to use regular expressions for the finding.

2. Searching/navigating

In this section we will see how to make searches, and also how to navigate through the files.

Find text in current file: Ctrl + F

The classical shortcut for many programs.

Find next coincide: F3 or Enter

Set the selection of the entered text to find in the following coincidence.

Find previous: Shift + F3

The same as the previous one, but for the previous coincidence.

Go to class: Ctrl + N

With this shortcut you can find a go to any class, receiving suggestions, like in the following image:

3. Navigating between classes.

Go to any file: Ctrl + Shift + N

The same as the previous one, but applicable to any file, not only classes.

Go to declaration: Ctrl + B

In this case, we have to place the cursor in element (object, method, attribute, parameter, etc.), and the IDE will navigate to the place of its declaration, even if it is in another file.

Go to implementations: Ctrl + Alt + B

If we place the cursor in a declaration (interfaces, abstract classes and methods), and we press this combination, IntelliJ IDEA will show a list of the places where it is being implemented to navigate to it, like shown in the following example:

4. Navigating to implementations.

If there’s only one implementation, the IDE will navigate directly to it.

Go to super-method/class: Ctrl + U

This is the same as the previous one, but reverse: navigating to the parent definition of a method or class.

Go to line & column: Ctrl + G

This shortcut will show a window where we can specify the line and column of the current file, to navigate to it. The format is line:column. But if we can also specify only the line, if the column is not necessary.

Switch between tabs: Ctrl + Tab

Just like, e.g., in web browsers.

3. Compiling and running

Compile project: Ctrl + F9

This just makes the project, without running it.

Select configuration and run: Alt + Shift + F10

This allows to configure the project before running it, selecting the main class, setting parameters for the JVM and the program, etc.

Run project: Shift + F10

Runs the project with the configuration set.

Select configuration and debug: Alt + Shift + F9

As same as selecting the configuration and running, but for debugging.

Debug project: Shift + F9

Equal to running the project, but debugging it.

4. Other shortcuts

Find action by name: Ctrl + Shift + A

A very useful shortcut, specially when you are not familiarized with other shortcuts yet. This allows to find any available action or option in IntelliJ IDEA, by the name, like shown in the following image:

5. Finding available actions by name.

Open settings: Ctrl + Alt + S

This will open the settings menu (File/Settings).

Toggle full screen editor: Ctrl + Shift + F12

For entering/exiting the full screen in the editor.

5. Vi/Vim fan? This is for you!

This is not exactly related to the IntelliJ IDEA shortcuts, but it’s worth mentioning.

If you are a former Vim user and you miss its commands, or you still use it and you don’t want to learn other shortcuts, or even if you want to learn to use it but using IntelliJ IDEA, there is a plugin for Vim emulation.

5.1. Installation

Open settings menu (Ctrl + Alt + S).

Go to plugins menu.

Click the “Install JetBrains plugin…” button.

Type “IdeaVim” in the search box.

Click the “Install” button, and restart the IDE.

5.2. Usage

To use the Vim emulator, the only thing we have to do is to ensure that Tools/Vim Emulator has a tick ✓. If checked, the editor will be in Vim mode. We can activate/deactivate whenever we want.

6. Summary

In this tutorial we have seen the IntelliJ IDEA shortcuts for code edition, navigation between files and compilation and execution of the project. Apart from that, we have also seen the Vim plugin for IntelliJ IDEA, that allows to have a better experience for Vim users.

Newsletter

Join them now to gain exclusive access to the latest news in the Java world, as well as insights about Android, Scala, Groovy and other related technologies.

Email address:

Receive Java & Developer job alerts in your Area

Leave this field empty if you're human:

Join Us

With 1,240,600 monthly unique visitors and over 500 authors we are placed among the top Java related sites around. Constantly being on the lookout for partners; we encourage you to join us. So If you have a blog with unique and interesting content then you should check out our JCG partners program. You can also be a guest writer for Java Code Geeks and hone your writing skills!

Disclaimer

All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners. Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries. Examples Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.