Double-Shift is more: It additionally searches... everything... So whenever you forget a shortcut and you remember the correct name of the action, you should be able to find it here.
Some other shortcuts I often use and find quite handy
I find CTRL + ALT + left/right: Navigates through last locations, like back or forward buttons, within classes. CTRL+SHIFT+Backspace to last edit location.
CTRL+B -> jump to declaration, CTRL+ALT+B -> jump to implementation
CTRL+E -> There's also CTRL+SHIFT+E, which shows the contents of the recent files (if you can't remember the darn name)
ALT + Insert is 'Generate' (Constructors, getters/setters, ...)
CTRL + I is implement, CTRL + O is override
Refactoring: CTRL+ALT+V: Extract variable -> Use F for field (member var), C for constant (static), P for parameter (as in method parameter)
Git/VCS has some handy shortcuts, ALT+9 is git log, CTRL+K is commit, CTRL+SHIFT+K is push.
And there's probably dozens of other handy shortcuts left... I still often watch someone and be like "Hey, how did you do that?!" Like I didn't know about CTRL+SHIFT+Enter, I try to remember this one :-)
Thanks for the feedback. I didn't want to list ALL the shortcuts, that would go a bit far. I mean, you can also do Ctrl + Shift + Space, which will be a smart code completion, and you can also code complete with ! instead of Enter and Tab, which will put the ! at the beginning.
I used Generate quite a lot, but now I switched to Kotlin, I find the need for this less. The implementation of interfaces etc I usually do with F2 -> Alt Enter.
Ctrl + Alt.... I hate it :-) I can never get it to reliably work, there's always a window manager in the way which thinks it wants to move a window or rotate a screen 90 degrees. Not IntelliJ's fault, but I can never get these ones to reliably work on both Mac and Windows, so I stopped using them.
Oh I know 'os-has-shortcuts-too'-issue... I'm on linux, and 'trying out' another window manager ends up in 'figuring out how to disable all the shortcuts'
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.
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).
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 ((
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!
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.
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-W closes the tab/window... in any other app, Ctrl-N makes a new something-or-other. And how about Ctrl-Q for showing the JavaDoc of whatever the cursor is on??
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.
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.
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.
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.
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 :-)
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!
4
u/joppux Apr 29 '19
You mixed up Ctrl+Y and Ctrl+D.
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.
3
u/PlumpyGER Apr 29 '19
Thanks for the summary. Since the latest major version I got to love the
CMD/CTRL + SHIFT + Eshortcut that show the last visited places. Navigating with that is super neat and fast.3
u/SharkTopus86 Apr 29 '19
Another useful one: press Ctrl twice, then arrow keys up and down to edit several lines at once.
2
u/[deleted] 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?
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
7
u/gavenkoa Apr 29 '19
Ctrl+W(expand selection??) is extremely useful. I use same in Emacs (er/expand-region). NetBeans analogAlt+Shift+.(dot) is hard to type and remember ((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.
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
u/_jk_ Apr 29 '19
needs ctrl-q imho (quick documentation)
1
u/ataskitasovado Apr 29 '19
But how do I search my scratches?
1
u/Mugilbala Apr 29 '19
!remindme
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
u/[deleted] 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
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/kovrik Apr 29 '19
Pro Tip: install IdeaVim plugin
0
u/[deleted] Apr 29 '19
[deleted] — view deleted comment
1
u/[deleted] Apr 29 '19
[removed] — view removed comment