Is there a way to create a new class in a desired location without using the mouse in IntelliJ?
I understand there is no keyboard binding in the default keymap.
For Mac Os, command + 1 , then press control + return
On Mac you can navigate to the location in Project view where you want to create your class and then use ⌘N
followed by Enter
.
If you are already in the Project View, press Alt+Insert (New) | Class. Project View can be activated via Alt+1.
To create a new class in the same directory as the current one use Ctrl+Alt+Insert (New...).
You can also do it from the Navigation Bar, press Alt+Home, then choose package with arrow keys, then press Alt+Insert.
Another useful shortcut is View | Select In (Alt+F1), Project (1), then Alt+Insert to create a class near the existing one or use arrow keys to navigate through the packages.
And yet another way is to just type the class name in the existing code where you want to use it, IDEA will highlight it in red as it doesn't exist yet, then press Alt+Enter for the Intention Actions pop-up, choose Create Class.
You can also use: ctrl+alt+insert