IntelliJ IDEA Tips and Shortcuts for Efficient Java Development
This article introduces a collection of lesser‑known but highly useful IntelliJ IDEA shortcuts and techniques—including custom keymap warnings, navigation shortcuts like ctrl+alt+h, alt+f7, bookmarks, code folding, and theme switching—to help Java developers read, navigate, and refactor code more efficiently.
Hello, I'm Lei Ge. This article introduces IntelliJ IDEA and lists many handy tips that developers may not have used before.
Do not customize shortcuts lightly
IntelliJ IDEA does not provide default shortcuts for many actions, so users must define them themselves, such as Rebuild Project and Compare With Branch . Be aware of three potential issues when customizing shortcuts: conflicts with other applications, difficulty remembering many shortcuts, and incompatibility when using a colleague's IDE configuration.
Every operation in IntelliJ IDEA corresponds to an action . You can invoke actions via ctrl+shift+a , for example to run Rebuild Project by typing its name and pressing Enter.
Be careful with ctrl+alt+h
The ctrl+alt+h shortcut shows the call hierarchy, but it may miss multiple invocations of the same method. For precise call locations, use alt+f7 instead.
public class TestService {
public void test1() {
System.out.println("aa");
}
public void test2() {
test1();
}
public void test3() {
test1();
// many business operations, then call test1() again
test1();
}
}To jump from a call hierarchy entry back to the source, select the entry and press f4 . To return to the ctrl+alt+h view, press alt+8 .
Quickly find Controller methods
When a project contains many controller methods, use ctrl+alt+shift+n and type part of the URL (e.g., /bill ) to locate them.
Bookmark key business methods
Use the bookmark feature to collect important methods. Example workflow: ctrl+f12 to list class methods, type the method name, f11 to add to bookmark, shift+f11 to show the bookmark list, and ctrl+enter to rename the bookmark.
Keep only one editor tab
Configure IntelliJ to use a single tab by pressing ctrl+shift+a , typing Editor Tabs , and setting Placement to None . Use ctrl+e to view recent files.
Read long and messy code efficiently
Use five tricks: create custom code folding blocks with ctrl+shift+. , match braces with ctrl+] or ctrl+[ , highlight variables with ctrl+shift+f7 and navigate with f3 , view definitions quickly with ctrl+shift+i , and find usages with alt+f7 .
Navigate to parent interface
From an implementation method, jump to its interface definition using ctrl+u .
Undo/redo changes
Use ctrl+z to undo and ctrl+shift+z to redo.
Switch color scheme quickly
Press ctrl + ` to open the color scheme selector, then choose a scheme and press Enter.
Source: https://urlify.cn/Rje2Ev
Architect's Tech Stack
Java backend, microservices, distributed systems, containerized programming, and more.
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.