I would like to present you some smart shortcuts, thanks to which if you spend a lot of time programming, you will be able to save up to 1 hour of time per week. I would like to point out right away that I will not list all the existing IntelliJ hotkeys here, because it would be a bit pointless (after all, you can check the official documentation or check the current configuration of the tool).
In the following article I will share with you the tricks that I use the most during my work myself. As time passes, I will try to update this post (if I find something new and worth your attention – I will definitely share with you).
Before we go to the main content of the article, I would like to draw your attention to a very useful plugin that you can install in IntelliJ. I mean the Key Promoter X exactly which helps you to learn essential shortcuts while you are working. When you use the mouse on a button inside the IDE, the Key Promoter X shows you the keyboard shortcut that you should have used instead. For me it was a really good way to start learning keyboard shortcuts.
That would be enough for the introduction. Now it’s time for the main part!
View management
Show/Hide project files [ALT + 1]
tutaj opis
Complete current statement [CTRL + SHIFT + ENTER]
Insert any necessary trailing symbols and put the caret where you can start typing the next statement.
Invoke refactoring [CTRL + ALT + SHIFT + T]
Refactor the element under the caret, for example, safe delete, copy, move, rename, and so on.
Change the Intellij project window [ALT + `]
The shortcut is useful when we work on more than one project at the same time
Quick documentation [CTRL + Q]
If you want more information about a symbol at caret, for example, where it comes from or what its type is, the Quick Documentation is your friend. Press Ctrl+Q to invoke it and you will see a popup with these details. If you don’t need the full info, then use the Type Info action instead: it only shows the type of the selected expression, but doesn’t take up that much of screen space.
Navigation
Search everywhere [Double SHIFT]
Displays a window to search for files
Go to file [CTRL + SHIFT + N]
go to file
Go to class [CTRL + N]
go to class
Go to symbol [CTRL + ALT + SHIFT + N]
go to symbol
Go to declaration [CTRL + B]
go to declaration
Recent files and locations [CTRL + E]
Normally, you work with a small subset of files at a time and need to switch between them quickly. The Recent Files action is a real time-saver here. Press Ctrl+E to see a list of last accessed files. Note that you can also use this action to open any tool window.
Quick access to recent locations [CTRL + SHIFT + E]
Apart from jumping to a recent file, you can also get quick access to Recent Locations – that is code snippets you last viewed or edited. Press Ctrl+Shift+E and you’ll be able to jump to a particular line you modified lately.
Refactoring
Refactor [CTRL + ALT + SHIFT + T]
Refactor this
Rename [SHIFT + F6]
Rename file or method
Extract variable [CTRL + ALT + V]
info about extracting variable
Extract field [CTRL + ALT + F]
method for extracting field
Extract constant [CTRL + ALT + C]
opis extract
Extract method [CTRL + ALT + M]
opis exract method
Extract parameter [CTRL + ALT + P]
method for extracting params
Inline [CTRL + ALT + N]
inline code
Move to the source of code [F4]
Jump to the source of a given method, variable, etc. – place the caret and click F4
DEBUGGING
Set line breakpoints [CTRL + F8]
Set line breakpoints, method breakpoints, field watchpoints
line breakpoints – kółko
method breakpoints – romb
Breakpoint configuration panel [CTRL + SHIFT + F8]
it shows main breakpoint panel
Debug tool window [ALT + 5]
show debug tool window
Evaluate selected code elements [CTRL + ALT + F8]
During debugging (when the debugger stops on the selected endpoint), you can hover over any code fragment to see the current value (e.g. on any variable) – after a while a balloon with the information will appear. If there are more complex fragments (greater than one variable, e.g. some calculations or functions), you can select a code fragment, and then Ctrl + Alt + F8
Evaluation [ALT + F8]
Estimating any expressions is possible after selecting a fragment (when stopped by a breakpoint) and selecting the Alt + F8 shortcut