How do I create a new class in IntelliJ without using the mouse?

前端 未结 10 1459
隐瞒了意图╮
隐瞒了意图╮ 2021-01-29 18:31

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.

相关标签:
10条回答
  • 2021-01-29 18:56

    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.

    0 讨论(0)
  • 2021-01-29 19:00

    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.

    0 讨论(0)
  • 2021-01-29 19:05

    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 )).

    0 讨论(0)
  • 2021-01-29 19:10

    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

    0 讨论(0)
  • 2021-01-29 19:13

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

    0 讨论(0)
  • 2021-01-29 19:15

    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 ...

    0 讨论(0)
提交回复
热议问题