Skip to content
loading...

What are your favorite IntelliJ shortcuts?

twitter logo github logo ・1 min read  

I'm a shortcut junkie, I love learning new ways to take control over the tools I use, whether it is IntelliJ, VS Code, or even a browser!

That's probably because I watched way too many episodes of Mr Robot.

I'm not gonna lie, it does make me feel a little bit like:

Hackerman

twitter logo DISCUSS (13)
markdown guide
 

Ctrl+Alt+M - Extract method
Ctrl+Alt+V - Extract variable/constant
Shift+F6 - Rename
Alt+F8 - Evaluate Expression (in debugging)
Crtl+Alt+O - Optimize imports

 

Oh! I've never used the Alt + F8, might have to give it a try.

About the CTRL + ALT + O to optimize imports, I've been using the automatic function inside IntelliJ's settings and it actually does a pretty good job. It's not perfect, but I would say it gets the imports right and cleans them up like 8/10 times.

This option can be enabled in Settings > Editor > General > Auto import > ... there will be 2 checkboxes for both:

  • Add unambiguous imports on the fly.
  • Optimize imports on the fly (for current project).
 

You can optionally optimise imports when formatting (Ctrl+Alt+L or ⌥⌘L).

If you add the shift key (⌥⇧⌘L) then the options will be displayed.

The options persist for subsequent formats.

 

I like to de-clutter the screen using Ctrl + Alt + F12 and using Alt + 12 to open up the terminal. I use Alt + n command to open up the panels with numbers. For e.g. Alt + 1 to open the project panel.

I use it with Vim plugin so I am mapped Alt + I to navigate to the source.

 

Here are my most used shortcuts:

  • CTRL-Q: Brings up docs
  • CTRL-B: Go to definition
  • SHIFT-F6: Rename
  • CTRL-SHIFT-T: Generate Empty Test Class <-- LOVE this
  • CTRL-ALT-O: Optimize imports (do this habitually all the time)
 

Woof!

Really nice ones!

I ended up overriding the default Rename shorcut since I like having the F# keys for controlling brightness and all that jazz without having to press the Fn key.

And CTRL-ALT-O + CTRL-ALT-L is as natural as breathing for me! hahaha.

 
 

For me it's gotta be the Find Action shortcut that gets triggered by pressing CTRL + SHIFT + A on Windows or CMD + SHIFT + A on macOS.

Since I constantly have to switch from my personal machine running macOS to Windows when I'm in the office, this is my safety net whenever I can't remember an specific shortcut. You can just type in the words and let the magical search do the rest.

 

I like Fabian's list, and I have one more: I have Show Intention Actions mapped to Alt-Return, and I use that all day long. I use that to declare local variables, create missing methods, create classes, etc.

 

I don't know about you, but there are a few that I love and one I REALLY don't like!

It's ALT+PERIOD

I use the French keyboard and to put a ">" I need to press just that. So every time I switch computer I need to change the shortcut for custom foldings.

I didn't know about Shift+F6! Really useful!

 

Ctrl alt l = format code
Tab arrow = move tab
alt insert = create constructor, getter & setter
alt mouse click left (windows) = insert caret
ctrl shift n = search file

 

Oh, I normally use Search Everywhere by double tapping SHIFT instead of the Search File, it's probably a faster way of finding an specific file.

And ALT + Insert is really good! Combining it with ALT + 1 to open and focus on the Project Explorer it let's you create new files too (depending on the folder you are highlighting).

Classic DEV Post from Mar 19

How do you come up with new side projects?

Side projects are great ways to grow our knowledge and skill, but where do you start? How do you get your ideas for new side projects?

Christian Vasquez profile image

dev.to now has dark mode.

Go to the "misc" section of your settings and select night theme ❤️