[IntelliJ] 5 shortcut settings for convenient operation

For efficient programming work, I think you will use an IDE that is easy for you to use.

I'm mainly developing in Java, and I used to love Eclipse, but now I've switched to IntelliJ. At first, it was unfamiliar and difficult to use, but now I can't let go of it.

Here's how to customize IntelliJ to make it even easier to use.

It may not be a hint for those who have already customized it, but there are surprisingly many people around me who take time to operate with the default settings. Also, I think that you may notice a method that you can't think of, so I'd be happy if you could refer to it.

What is IntelliJ

Let me briefly explain about IntelliJ.

IntteliJ is a Java IDE (Integrated Development Environment) provided by JetBrains. In Java, open source Eclipse has been used for many years and was in the de facto standard position, but it is said that it broke the stronghold of Eclipse.

IntelliJ has a Community version (free) and a Pro version (paid). The Community version also has enough features, so I hope that people who are currently using Eclipse will try it once.

By the way, PHP Storm, which is said to be the strongest IDE in PHP, is also a product of JetBrains.

Prerequisites for customization

As a premise of this article, I am customizing based on the Eclipse keymap. The reason is simply that we want to unify the keymaps.

That's because the Java IDE is currently in transition from Eclipse to IntelliJ. If you change the site, you may end up in an environment where you can only use Eclipse (it has become a reality), and it's a waste of time to get used to IDEs with different operability.

Therefore, we are taking measures to reduce problems by unifying the default keymap. I hope you understand that. So, I'll duplicate the base settings first.

◆ File ⇒ Settings

image.png

◆ Left: Select keymap Middle: Select Eclipse Right: Duplicate

image.png

Customize IntelliJ shortcuts

Now, let's customize the shortcut of the main subject. The following 5 shortcuts are set this time.

--Display in Explorer: "Ctrl + Shift + Q" --Rename: F2 --Branch: "Ctrl +-" --Fetch: "Ctrl + ^" --Pull: "Ctrl + "

View in Explorer: "Ctrl + Shift + Q"

Open the file that is currently in focus or the parent folder of the folder in Explorer. The original operation is [Right click] → [View in Explorer] in the project on the left.

image.png

File operations can basically be operated from IntelliJ, so it may be used less frequently, but it will be very convenient if you set it. You can set any shortcut, but this time I set it to "Ctrl + Shift + Q".

Since it is the first one, I will also describe the registration method.

◆ File ⇒ Settings

image.png

◆ Keymap ⇒ Search by "Explorer" image.png

◆ Right-click with the corresponding command ⇒ Add keyboard shortcut image.png

◆ Enter a shortcut ⇒ OK image.png

"Ctrl + Shift + Q" is now assigned "View in Explorer". So Other shortcuts can be changed in the same way.

image.png

Rename: F2

Refactor the entire project after renaming the class and file. The original operation is "Refactoring ⇒ Rename".

It's not just a renaming, it's an excellent one that automatically renames all files. Especially during development, I use it quite often, so make sure that you can operate it quickly. I assigned it to "F2" because I wanted it to feel the same as the Explorer.

image.png

Branch: "Ctrl +-"

It is used to perform various operations related to branches such as checking and switching branches of git. The original operation is "VCS ⇒ Git ⇒ branch".

image.png

As you can see, it's a troublesome operation, so let's register it as a shortcut. I assigned it to "Ctrl +-". Now you can operate the branch. The repair work will also progress.

image.png

Fetch: "Ctrl + ^"

This is the operation to execute the "git fetch" command. The original operation is "VCS ⇒ Git ⇒ fetch".

image.png

In IntelliJ, even if you perform a pull operation on the IDE, the remote branch to be referenced may not be up to date, and this can be solved by fetching once. Fetch ⇒ pull will be used in a series of flows. Of course, do it before you check out.

image.png

Pull: "Ctrl + "

This is the operation to execute the "git pull" command. The original operation is "VCS⇒Git⇒Pull".

image.png

There are a few situations where pulls are used, but if conflicts occur frequently in the early stages of development, it may be better to proceed without creating a branch. In this case, you will evacuate the local source with a stash or shelve and use fetch ⇒ pull frequently.

There is no problem with checking out with another name, but with IntelliJ, pulling can be executed faster and it will lead to speed improvement.

image.png

Finally: Customize IntelliJ to your liking

Introduced with a focus on customizing IntelliJ shortcuts. This time there are many operations related to git, and if you do not use git, the benefits may be small, but I think that it will be a hint for efficiency.

Making keymap changes is very important. Even if each operation is small, it should be as short as possible if it is to be performed many times.

However, it is not possible to register all of them as shortcuts, so let's actively register shortcuts focusing on the functions that you use frequently and the operations that you feel stressed.

You can register a shortcut in 1 minute. Don't lose more than a minute!

Recommended Posts

[IntelliJ] 5 shortcut settings for convenient operation
IntelliJ IDEA Convenient function for beginners (importance ★ 4)
IntelliJ IDEA Convenient function for beginners (importance ★ 5)
IntelliJ IDEA settings
IntelliJ Frequently Used Operation Notes
Gradle settings for using JUnit 5
Shortcut comparison for those migrating from Eclipse to IntelliJ IDEA (Windows)