IntelliJ IDEA — tips and tricks in 5 minutes
I am using IntelliJ IDEA in my everyday work. I’m in love with this IDE. Even after several years of working in this IDE some functions were hidden from me. In this post I would like to share some configuration settings, plugins and functions I use.
Lets start from configuration and proceed to useful plugins and functions.
Remove default file and code templates
From my perspective these templates pollute your code and give no benefits. You can find author and dates in VCS logs.


Auto Import
Stop doing importing manually. When the class is unique IDEA will automatically add it to the imports. Same with optimizing imports. If import is unused in my code then it shouldn't be there.

Inspections
IntelliJ have some cool inspections. By default some of them are disabled. I highly recommend you to go through inspection list and check ones you prefer. Especially in Class Structure, Class maturity issues, Code style issues, Probable bugs sections.
IDEA will analyze your code and show warnings with possible fixes. You can increase quality of the code and encourage some good practices in the project for free.

IntelliJ doesn't run full code analysis on the fly. In order to run all configured inspections use Analyze -> Inspect Code action. Don’t forget to assign a shortcut for it!
VM Options
Working on a big project with thousand classes? You would prefer to adjust your IDE VM options. VM options are located in IDE_HOME\bin\idea[64][.exe].vmoptions file.
-XmsXXXm
-XmxXXXm
-XX:MaxPermSize=XXXm
-XX:ReservedCodeCacheSize=XXXm
In Java 8 PermGen memory space was removed. Metaspace is replacement for it. If you are running Java 8 then you need to use these options:
-XX:MetaspaceSize=XXXm
-XX:MaxMetaspaceSize=XXXm
Plugins
There is Plugin Repository with many useful plugins for IntelliJ IDEA.
During first installation IntelliJ IDEA offers to enable some bundled plugins. Disable ones you don’t use, this will speed up your IDE.
Gerrit
We use Gerrit as code review tool in our company. Gerrit plugin allows doing reviews directly from the IDE.

Bash Support
Doesn't come out of the box, but can easily be installed. If you are writing a lot of scripts quick definition look-up (Ctrl+Shift+I) and navigation to declaration (Ctrl+B) can save your time.
Key Promoter plugin
Do you wish to learn shortcuts fast? I’d recommend you to get this plugin. It displays popup whenever you do an action with mouse instead of using shortcut. If you repeat an action multiple times it suggests you to assign shortcut to that action.

String manipulation
Straightforward plugin which saves you tons of time and efforts. By default context menu is mapped to Alt+Shift+M.

.ignore
This plugin makes me happy. It goes beyond simple .gitignore support. Syntax highlights, file generator and user templates support. I don’t need to store personal .ignore file anymore.


Navigation
Navigation without mouse is a must! Put a printed reference under the keyboard and start learning the keys. Try to minimize interactions with mouse.
My favourite shortcuts are:
- Recent Files — Ctrl+E (open popup and type for search)
- Hide active window — Shift+Esc
- VCS quick popup — Alt+BackQuote(`)
- Go to class — Ctrl+N
- Go to file — Ctrl+Shift+N
- Show usages — Ctrl+Alt+F7 (I prefer to have it on Alt+F7)
- Navigate back/forward — Ctrl+Alt+Left/Right
- Extract method/variable/field /constant/param— Ctrl+Alt+M/V/F/C/P
- Select current file or symbol in any view — Alt+F1
- File structure popup — Ctrl+F12
- Open quick definition popup — Ctrl+Shift+I

Instant keymap switching
You wonder why this could be needed? Pair programming! Many of us customize shortcuts we use in IDE. If you often pair program with your mate share your keymap settings. Later you can switch between keymaps at no cost.
Simple and fast: Ctrl+BackQuote(`)

Analyze Stacktrace
A very convenient way to analyze stacktrace available outside your IDE. For the first time go to Analyze -> Analyze Stacktrace. Check “Automatically detect and analyze thread dumps…”. Now whenever you copy stacktrace to your clipboard and switch to IntelliJ IDEA it will show popup with formatted stacktrace.

Thanks for reading this post. I hope you enjoyed and found it useful.