Boost Your Java Productivity: Hidden IntelliJ IDEA Tricks You Must Try
Discover a collection of powerful IntelliJ IDEA shortcuts and features—including Presentation Mode, Inject Language, split‑pane navigation, automatic brace insertion, symbol search, structural search, and more—that help Java developers code faster, stay focused, and avoid common pitfalls.
Overview
IntelliJ IDEA becomes more powerful the more you use it, constantly offering small surprises while coding. Inspired by this love, the author shares a series of useful IntelliJ IDEA tips, with this article covering many practical tricks you may not know.
My Favorite Presentation Mode
Use
Alt+Vto open the View menu and select
Enter Presentation Mode, which maximizes the IDE window and lets you focus on a single class without distractions. To exit, press
Alt+Vagain and choose
Exit Presentation Mode. You can also switch between classes quickly with
CTRL+E,
CTRL+N, or
CTRL+SHIFT+N.
Magical Inject Language
When editing JSON strings, avoid manual escaping of double quotes. Place the cursor inside the quotes, press
Alt+Enter, choose
Inject language or reference, press
Enter, and select the
jsonlanguage. The IDE will automatically handle escaping. Use
Alt+Enteragain to edit the JSON fragment, and press
Ctrl+F4to close the view.
Move Splitter with Keyboard
If a class name is hidden in the Project view, press
Alt+1to focus the Project view, then use
Ctrl+Shift+←/→to move the splitter and reveal the hidden part.
Ctrl+Shift+Enter Does More Than Add Semicolons
Press
Ctrl+Shift+Enterto let IDEA automatically complete statements, such as adding missing braces for an
ifblock.
Avoid Overusing Refactor for Simple Text Changes
To replace multiple occurrences of a text like
rabbitTemplate, press
Ctrl+Wto select the word, then press
Alt+Jrepeatedly to add the next occurrences, allowing batch editing without invoking the refactor dialog.
Hide the Navigation Bar
Press
Alt+Vand uncheck
Navigation Barto declutter the IDE. If you need it temporarily, press
Alt+Hometo show it, and
Escto hide it again.
Locate a Class in Project View
Press
Alt+F1, choose
Select in Project View, then select
Projectand press
Enterto jump directly to the class location. Use
Escto return to the editor, or
F4to open the file.
Powerful Symbol Search
Press
Ctrl+Shift+Alt+Nand type a symbol name (e.g.,
user) to quickly find methods or classes.
Find Directories Quickly
Press
Ctrl+Shift+N, type
/followed by the directory name to locate it instantly.
Auto‑Generate Not‑Null Checks
After typing
rabbitTemplate., enter
notnulland press
Enter; IDEA will generate the corresponding
ifstatement automatically.
Find Code by Template
Use
Ctrl+Shift+Ato open the Action dialog, type
Search Struct, select
Search Structurally, then choose an existing template (e.g.,
try). Adjust the
Maximum countvariable for
CatchStatementto 1, edit variables if needed, and click
Findto locate all
try‑catchblocks where the
catchdoes not handle the exception.
macrozheng
Dedicated to Java tech sharing and dissecting top open-source projects. Topics include Spring Boot, Spring Cloud, Docker, Kubernetes and more. Author’s GitHub project “mall” has 50K+ stars.
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.