IntelliJ IDEA Tips and Tricks for Efficient Development
This article presents a comprehensive guide to IntelliJ IDEA, covering high‑efficiency configurations, essential shortcuts, code templates, debugging techniques, and recommended plugins, aiming to help both newcomers and experienced developers boost productivity and fully leverage the IDE’s powerful features.
Preface
If a worker wants to do a good job, he must first sharpen his tools.
Recently I was invited by my department to give a unified training on IntelliJ IDEA for new hires. I discovered that many newcomers use only basic functions of this excellent IDE, missing many useful tricks. After preparing the material I also learned new tips myself, so I share them here to help others.
Based on IDEA version: IntelliJ IDEA 2018.2.2 (Ultimate Edition)
Knowledge overview:
High‑efficiency configuration
Daily essential shortcuts (★★)
Search
Navigation & switching
Coding related
Code reading related
Version control related
Coding efficiency (★★)
File code templates
Live templates
Other custom templates
Code debugging & source reading (★★★)
Plugins
References
High‑efficiency Configuration
1. Case‑insensitive code completion
Settings → Editor → General → Code Completion
(In lower versions set Case sensitive completion to None.)
2. Auto‑import and related optimizations
Settings → Editor → General → Auto Import
3. Adjust font size with Ctrl + mouse wheel
Settings → Editor → General → Change font size (Zoom) with Ctrl+Mouse wheel
After enabling this option you can zoom the editor font size by holding Ctrl and scrolling the mouse wheel.
4. Show tabs in multiple rows
Some developers prefer to keep all tabs visible. To enable this, go to:
Window → Editor Tabs → Tabs Placement, and uncheck Show Tabs In Single Row .
Result:
5. Show line numbers in the editor
Settings → Editor → General → Appearance → Show Line Numbers
Daily Essential Shortcuts (★★)
Search
Navigation & Switching
Coding Related
Code Reading Related
Version Control Related
Coding Efficiency (★★)
File Code Templates
Settings → Editor → File and Code Template
Here you can view all built‑in file templates. When you create a new file, IDEA generates code according to the selected template. You can also set file headers.
Result after setting a header:
Live Templates
IDEA provides powerful live templates. For example, typing sout expands to System.out.println(); and psvm expands to a public static void main(String[] args) {} method.
These templates are managed at:
Settings → Editor → Live TemplatesCustom Code Templates
IDEA also allows you to create your own template libraries and custom templates.
Create your own template library
Create custom code templates
Other Handy Shortcuts
Ctrl + Alt + T (Surround With)
Ctrl + Alt + Topens the “Surround With” menu, allowing you to wrap selected code with constructs such as if, try/catch, etc.
Local History
IDEA includes a built‑in local history feature that lets you safely track and revert changes made to your code.
Code Debugging & Source Reading (★★★)
View Modes
IDEA offers two special view modes:
Presentation Mode – for code review or demo presentations.
Distraction‑Free Mode – a Zen mode that focuses on code.
Debugging Features
1. Conditional Breakpoints
Set breakpoints that trigger only when a specified condition is true, improving debugging efficiency.
2. Force Return
During a breakpoint you can force a method to return a custom value, which is very flexible.
3. Simulate Exception
You can force an exception to be thrown at a breakpoint, useful when debugging library code.
4. Evaluate Expression
While debugging, you can modify variable values on the fly using the “Evaluate Expression” feature.
Plugins
Plugin Installation
File → Settings → Plugin
Plugins can be searched and installed directly from the IDEA plugin repository. If the network is poor, download the zip from the official site (https://plugins.jetbrains.com) and use “Install from Disk”.
Recommended Plugins
My daily development plugins include:
Alibaba Java Coding Guidelines – enforces Alibaba’s Java coding standards.
FindBugs – static code analysis for bug detection.
PMD – another static analysis tool.
InnerBuilder – quickly generate builder pattern code.
Lombok Plugin – supports Lombok annotations.
Maven Helper – visualizes Maven dependency trees and conflicts.
Rainbow Brackets – color‑codes matching brackets.
String Manipulation – assists with string operations (used with Ctrl+W, Alt+J, etc.).
Translation – translates selected text, handy for reading source code.
GenerateAllSetter – batch generates setter methods.
Key Promoter X – reminds you of keyboard shortcuts for mouse actions.
GenerateSerialVersionUID – quickly creates serialVersionUID fields.
GsonFormat – formats JSON strings into Java objects.
RestfulToolkit – jump to REST APIs, view API structures, and send simple HTTP requests.
Material Theme UI – my preferred UI theme.
MyBatis Log Plugin – restores full SQL statements from MyBatis logs.
Free MyBatis – a free MyBatis helper plugin.
Reference Links
Pure Spring Security Architecture Sharing (recommended by a fellow programmer)
Dada O2O Backend Architecture Evolution: Handling 4,000 High‑Concurrency Requests
iQIYI’s Database Selection Practices
OPPO’s Million‑Level MongoDB Cluster Optimization
Alibaba Cloud Redis Development Guidelines
My 10‑Hour Guide to Alibaba Data Platform Analytics
Nginx Core Architecture: Why It Supports High Concurrency
Volatile Keyword Interview Questions (Must‑Know)
5‑Minute Cache Consistency Optimization
-END-
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Architecture Digest
Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
