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:
Top comments (13)
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: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.
Here are my most used shortcuts:
CTRL-Q
: Brings up docsCTRL-B
: Go to definitionSHIFT-F6
: RenameCTRL-SHIFT-T
: Generate Empty Test Class <-- LOVE thisCTRL-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 theFn
key.And
CTRL-ALT-O
+CTRL-ALT-L
is as natural as breathing for me! hahaha.YES! Generate Test FTW.
For me it's gotta be the
Find Action
shortcut that gets triggered by pressingCTRL + SHIFT + A
on Windows orCMD + 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 to de-clutter the screen using
Ctrl + Alt + F12
and usingAlt + 12
to open up the terminal. I useAlt + 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.I like Fabian's list, and I have one more: I have
Show Intention Actions
mapped toAlt-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!
Have you heard of Eventghost?
Lets you take control of windows and automate all kinds of stuff, I have short cuts for the wildest stuff dude.
dev-to-uploads.s3.amazonaws.com/i/...
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 tappingSHIFT
instead of theSearch File
, it's probably a faster way of finding an specific file.And
ALT + Insert
is really good! Combining it withALT + 1
to open and focus on the Project Explorer it let's you create new files too (depending on the folder you are highlighting).