r/java • u/bodiam • Apr 29 '19
Essential IntelliJ Shortcuts
https://www.jworks.io/essential-intellij-shortcuts/4
u/joppux Apr 29 '19
You mixed up Ctrl+Y and Ctrl+D.
3
u/bodiam Apr 29 '19
haha. Oops!! Thanks for spotting it, I'm going to fix it right away!
3
u/BinaryRockStar Apr 29 '19
Also "semi column" should be "semi colon". Thanks for the list, a few I didn't know.
2
4
u/jacobmccall Apr 29 '19
https://resources.jetbrains.com/storage/products/intellij-idea/docs/IntelliJIDEA_ReferenceCard.pdf
This is the "official" default key map. This can save a lot of time when you learn your most frequently used buttons key strokes.
1
3
u/PlumpyGER Apr 29 '19
Thanks for the summary. Since the latest major version I got to love the CMD/CTRL + SHIFT + E shortcut that show the last visited places. Navigating with that is super neat and fast.
1
u/bodiam May 05 '19
Why since the last major version? The shortcut has been there for a long time, did something change?
1
u/PlumpyGER May 05 '19
Yes. The "recent locations popup" is new in the 2019 edition. See here: https://www.jetbrains.com/idea/whatsnew/
Maybe you mixed it up with just
CMD + E1
3
u/SharkTopus86 Apr 29 '19
Another useful one: press Ctrl twice, then arrow keys up and down to edit several lines at once.
1
2
Apr 29 '19
Is ctrl alt V the same thing as typing .var at the end of a statement and letting it create the variables?
1
u/bodiam May 05 '19
.var ? I've never tried that. How does that work?
1
u/TyGirium May 08 '19
Its the same :) type new A().var, then Ctrl Space, effect will be same as selecting and pressing ctrl al v
15
u/BEgaming Apr 29 '19
nice write up, with some stuff i didn't know (press SHIFT + F6 twice for example).
One I personally like to use is CTRL+SHIFT+A to search a certain action or shortcut. (nowadays it is also integrated in the menu when you click SHIFT twice).
I can also recommend this tutorial: https://javaspecialists.teachable.com/p/intellij-wizardry
2
7
u/gavenkoa Apr 29 '19
Ctrl+W (expand selection??) is extremely useful. I use same in Emacs (er/expand-region). NetBeans analog Alt+Shift+. (dot) is hard to type and remember ((
6
Apr 29 '19
[removed] — view removed comment
3
u/gavenkoa Apr 29 '19
For sure!
Ctrl+Wcloses tabs in most programs.I was pissed off by Mac OS X key bindings... How is that possible to maintain completely different keyboard shortcuts for different OS? I tried to pass my knowledge of effective work in Idea for Mac dev and I failed!
3
u/MacBelieve Apr 30 '19
Option up arrow for expand selection
1
u/-manabreak Apr 30 '19
I use cmd + up and cmd + down in rapid succession to navigate to the class start. Quite useful when you're working on big classes and need to go tweak the fields.
1
u/IamPic Apr 29 '19
Yeah, I remap most of IntelliJ's shortcuts. Changed this to
Ctrl + Efor extend. Also changed delete line toCtrl + Dfor delete.1
u/GreatArkleseizure Apr 29 '19
This is what annoys me about IntelliJ, which is otherwise a wonderful IDE ... but they go a little off-the-rails with their keyboard shortcut. In any other app,
Ctrl-Wcloses the tab/window... in any other app,Ctrl-Nmakes a new something-or-other. And how aboutCtrl-Qfor showing the JavaDoc of whatever the cursor is on??2
u/Olivki Apr 30 '19
If I remember correctly in the new 2019.1 release of IntelliJ it will actually ask you if you want CTRL+W to close the current tab or use the other behaviour the first time you press it.
2
u/Tauo Apr 29 '19 edited Apr 29 '19
Great stuff, definitely a couple on here I should have been more aware of.
The biggest omission I noticed that I use extremely frequently is Ctrl+Alt+H to view call hierarchy. More informative and easier to navigate than the Usages window imo.
1
u/bodiam Apr 29 '19
Interesting! Thanks for sharing, I tried using it, but the focus always goes to the hierarchy screen, and it somehow always shows me the wrong information. Maybe I should have another look at it.
4
u/Fabbbrrr Apr 29 '19
For Mac but it should be similar in windows: CMD + shift + v is multi clipboard paste. Such an useful tool!
4
u/hooba_stank_ Apr 29 '19
These are also useful for me:
Ctrl + Alt + T (surround with... try/catch, if etc)
Ctrl + J + iter/fori/...(generate loops)
Ctrl + Alt + O (optimize imports)
Ctrl + Alt + L (format code)
3
u/CubsThisYear Apr 29 '19
Pro-tip: you should remap “find usages” to Ctrl-Shift G. This happens to be the Eclipse shortcut for this, but it’s not used in IntelliJ for anything. I use this function constantly and it’s way easier to type than moving your hands all the way to the function keys.
3
u/achacha Apr 29 '19 edited Apr 29 '19
TL;DR: install the Key Promoter X plugin
For us OSX users (or anyone using a different keymapping set), this is not as useful, however the plugin suggestion is a nice idea.
2
1
1
1
u/AndDontCallMePammy Apr 29 '19 edited Apr 29 '19
Find Usages is Alt + F7
Show Usages is Ctrl + Alt + 7
At least on latest community XWin
1
Apr 29 '19
Does anyone know if there’s a way to place one cursor on each line in a selected block?
In sublime text for instance, you can select a block and press ctrl + shift + l
2
u/crazysmoove Apr 29 '19
Not exactly the same, but close: put the cursor where you want it first (i.e., in the first column of the first line), then "double-tap" the Ctrl key to switch to "multiple cursor" mode (the second time, I think you have to hold it down), then hit the down arrow (while still holding Ctrl down) and it will put cursors on each line that you "down-arrow" to. When you're done, let go of the Ctrl key and do your thing -- it will apply your keystrokes to every cursor.
Edit: Just realized that SharkTopus86 mentions this below. What he said :-)
1
u/jasonlhy May 03 '19
My favourite one is Ctrl + W, and you can horizontally scroll by pressing the shift button and move the mouse wheel.
1
u/rinhbt Apr 29 '19
!remindme
1
u/RemindMeBot Apr 29 '19
Defaulted to one day.
I will be messaging you on 2019-04-30 14:38:09 UTC to remind you of this link.
CLICK THIS LINK to send a PM to also be reminded and to reduce spam.
Parent commenter can delete this message to hide from others.
FAQs Custom Your Reminders Feedback Code Browser Extensions
1
0
Apr 29 '19
[deleted]
2
6
u/crunchmuncher Apr 29 '19
Shift+Alt+J (I think? Otherwise Ctrl+Alt+J) to mark every occurrence at once, which is also often useful for me.
4
1
7
u/bodiam Apr 29 '19
I wrote a small list of intellij shorts which my colleagues and I use on a daily basis, and hopefully it might help others!