[intellij-idea] How do I create a new class in IntelliJ without using the mouse?

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.

This question is related to intellij-idea

The answer is


With Esc and Command + 1 you can navigate between project view and editor area - back and forward, in this way you can select the folder/location you need

With Control +Option + N you can trigger New file menu and select whatever you need, class, interface, file, etc. This works in editor as well in project view and it relates to the current selected location

// please consider that this is working with standard key mapping


You can also use: ctrl+alt+insert


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.


I also searched this answer. Equivalent of command+N on Mac OS for Windows is ctr + alt + insert which @manyways already answered. If you searching this in settings it is in Settings > IDE Settings > Keymap, Other > New ...


If you use Mac, you are in luck. One can change the keymap for Intellij as Mac OS X, then you can use option+C.


On Mac OS 10.14.5, Idea Intellij 2019.1.3 - Press command + 1 to navigate to project files then press control + n


In my (linux mint) system I can not get working combination alt+insert so I do the next steps:

alt+1 (navigate to "tree") --> "context button - analog right mouse click" (between right alt and ctrl) -- then with arrows (up or down) desired choice (create new class or package or ...)

Hope it helps some "mint" owners )).


I do this a lot, and I don't have an insert key on my laptop, so I made my own keybinding for it. You can do this by opening Settings > IDE Settings > Keymap and navigating to Main menu > File > New... (I would recommend typing "new" into the search box - that will narrow it down considerably).

Then you can add a new keyboard shortcut for it by double clicking on that item and selecting Add Keyboard Shortcut.


For Mac Os, command + 1 , then press control + return