DAILY SUPER-POWERS
Mastering IntelliJ IDE to Boost your Productivity
Learn about its awesome features, shortcuts & plugins to save significant time every day & bring your coding to the next level.
As a developer, your IDE is your main tool for building products and you’re spending a significant amount of time with it. That’s why you should use it as efficiently as possible — knowing about its most powerful features, shortcuts and plugins.
What I’ll cover in this article:
- Features — get to know the most valuable features, that are not immediately obvious.
- Shortcuts — write code and navigate efficiently and quickly.
- Plugins — get even more out of IntelliJ by using community plugins.
- Key takeaways
Disclaimer: As I’m a Mac user, I’ll only add shortcuts for macOS, but you can find the corresponding ones for other OS at IntelliJ’s key map.
Features
There’s a lot, like auto-completion, syntax highlighting, and so on. I’ll go into the ones which are not too obvious or known by everybody, but will have a great benefit for your daily work.
Splitting Tabs
By right-clicking on a tab, you can create split view — either horizontally, vertically or both. This for example helps immensely for writing tests as you can have your implementation right next to your test code while writing them.
Local History
Did you ever messed up so intensively that you can’t even restore something with git? Even if you threw away your day of work with a git reset --hard HEAD
, IntelliJ is here to rescue you with it’s own version control.
The tracking not only covers changes you did within the IDE, but also external changes, regardless of the actual initiator. So for example, accidentally dropped changes via some terminal command outside of IntelliJ can be easily recovered.
Invoking any code while running the debugger
When running the debugger and setting certain breakpoints, often you’ll end up with only needing minor adaptions to fix your code. IntelliJ helps immensely by allowing you to execute code directly with the evaluation panel via ⌥
F8
. You can adapt specific assignments, access all variables in your current scope, import additional classes or run any arbitrary code. That allows you to validate parts of your fixes without needing to restart your debug run.
Shortcuts
Using your keyboard as often as possible by taking advantage of shortcuts will save you a lot of time. It’s much more convenient and faster compared to using your mouse and finding some action inside a (sub-)menu.
Actions menu
That’s probably the most valuable one, as you can directly use almost any feature from within. Pressing ⌘
⇧
A
opens the actions menu, which enables you to browse all commands via a full-text search. This also includes functions from plugins like String Manipulation.
What really love: switching between projects with ⌘ ⇧ a + ‘open recent’
which will display the projects overview. It’s perfect for commands you use regularly, but not as often as that you would be in need for a dedicated shortcut.
Search everywhere & jumping to recent files
By pressing ⇧
twice, you’re opening the file browser, enabling to open any file in your current project.
If you’re pressing ⌘
e
IntelliJ will show you the files you recently interacted with. Even if this does not show you an input, you can still do a search inside by just starting to type. This is generally possibly at all different places for example while browsing your git changes or navigating in your project overview.
Multi-Cursor Selection
Often, you need to do the sames modifications on a set of items. Instead of going through them one-by-on, you can do a multi-cursor selection and edit everything at one.
⌃
g
(add selection for next occurrence)— will select the next occurrence for the string you have currently selected. This can be done until there are no more matches inside the document.⌘
⌃
g
(select all occurrences)— will select all occurrences for the selected string in the current file.⌥
⇧
+mouse click
(add or remove caret)— adds another caret or removes the one which is currently at your mouse pointer.⌥
⌥
& hold—the next presses of↑
or↓
(arrow keys) will add another caret on the upper or lower line.
Completing Statements
With IntelliJ, it’s not necessary to write constructs like if
, do
, while
, try/catch
again and again yourself. By just typing the keyword and pressing ⇧
⌘
⏎
, the skeleton code block will be auto-generated.
Refactoring
Refactoring code is a regular task and this two feature help a lot with that.
⇧
F6
(renaming) — for renaming a variable, class or method. This will edit all references.⌥
⌘
v
(variable refactoring) — extract the current selection to a new variable. If you use this exact same pattern at several places, IntelliJ will ask you if you want to replace it also at the other occurrences.
Creating a new Scratch File
Many times there’s a need to create some file quickly for scribbles, reformatting something or just trying something out in a temporary manner. With ⌘
⇧
n
you’ll open the scratch menu for creating a new file with an extension of your choice. Continue typing to find your desired file type.
Show usages & jumping to implementations
A lot of times you want to know where you current function or class is used. By pressing ⌘
click
(or ⌥
⌘
F7
if your caret is on target), you’ll be either shown a list where your target is used or directly be taken there, if there’s only a single one.
By pressing ⌘
⌥
on an interface, IntelliJ will show you the implementations of this method or class.
Deleting & moving lines
You can delete the current line where you caret sits by pressing ⌘
⌫
or move it up or down with ⌥
⇧
+ ↑
or ↓
.
Showing documentation
By pressing F1
you’ll be shown the documentation of the method or class of your current caret position.
Moving elements (e.g. parameters)
If you caret is currently placed at a method signatures parameter, you can move it left or right by pressing ⌥
⇧
⌘
+ ←
or →
. If your method is already in use, you can also propagate it the all places where it’s invoked by pressing ⌥
⏎
and selecting Apply signature change
after finishing your signature adaptions.
Commenting/Uncomment
Easily move a selection or line into a comment (or multiple ones if multi-carets are active).
⌘
/
— single line comments (//…
)⌥
⌘
/
:— for block comments (/*…*/
)
… there’s more!
That’s just a small selection of shortcuts I found to be the most useful in my daily work.
Don’t hesitate visiting Help > Productivity Guide
— it will display you features and its corresponding shortcuts with a detailed explanation. Also, it shows how often you’ve used them and some more interesting statistics.
Plugins
There are a lot of plugins which are built for easier working with a specific language, but I’ll only focus on the ones for enhancing general productivity.
Material Theme UI
Not directly related to productivity enhancements, but we’re looking at our IDE for hours a day and having a proper editor theme can make this a lot more bearable. With Material Theme UI you’ll get a lot of different themes and other small improvements like icon sets.
String Manipulation
Writing code means writing text and working with strings. A lot of them. String Manipulation (⌥
⇧
m
) adds a whole toolbox to your IDE so you can easily switch, sort, filter, increment, align to columns, grep, escape, encode and much more.
Rainbow Brackets
Brackets — regardless which one — are programmers best friend and sometimes worst enemy. Complex code can get overwhelming solely due to the fact that it’s not easy to comprehend which opening bracket relates to which closing one. Rainbow brackets helps with that by coloring your brackets.
Github
Let’s be honest: reviewing pull requests on Github’s website is no fun. Especially for larger ones, even the side-by-side view does not help. With Github’s IntelliJ plugin you can review your pull requests inside your IDE, which makes it a lot easier because you can jump through code segments and references, view implementations or abstractions and by that get a better understanding on what’s going on.
SonarLint
Adding code or changing it always comes with a chance to introduce new bugs. That’s why it’s recommendable to use a static code analysis tool like SonarLint. It helps to discover bugs, vulnerabilities and code smells before opening your pull request.
PlantUML
If you’re working as a software architect or backend developer, you’re spending a lot of time defining & building systems and finding the best orchestrations.
PlantUML enables you to quickly write (not draw) all kinds of diagrams — from sequence diagrams to component diagrams — with a simple and intuitive syntax. The PlantUML Integration plugin will do the auto-generation of the actual diagram for you, so you don’t need to spend time with resizing and dragging boxes. Every update to your code will create an updated version.
With that, you can easily keep complex system documentation as code inside your repository. It’s easily one of my most favorite plugins and tools.
BashSupport Pro
In advance: this plugin is only available via a subscription, but if you’re working a lot with Bash, you’ll get more than enough for your money.
BashSupport Pro gives you the full toolbox to love scripting with bash or shell. It brings a debugger and code-completion, displays you hints from ShellCheck, and much more.
AWS Toolkit
Nowadays, there’s a good chance that a lot your daily business evolves around working with AWS. If this is the case, AWS Toolkit is a must have.
It allows you to connect to certain AWS services directly from your IDE. For example, you can browser CloudWatch logs and S3 buckets or deploy or invoke Lambda functions with a single click.
Key takeaways
Knowing the details of your IDE will save you a lot of time and let you work in a more efficient manner. That’s especially true for such a powerful IDE like IntelliJ. In this article we’ve gone through a set of useful features, shortcuts and plugins to get the most out of it.
Invest today in learning them, getting used to it and probably finding out about even more features that enhance your productivity.
Saving a few seconds or minute every here and then doesn’t sound much, but doing this over weeks and months will save you whole days of work.
Thank you for reading.