8

In JetBrains Rider, is there keyboard shortcut to add a new class file? Perhaps with the same popup to name the C# class, then to save in the currently selected/open directory.

Would save many mouse clicks :-)

Rax
  • 665
  • 8
  • 19

2 Answers2

11

To generate new class file in Rider:

Method 1

  1. In the Solution Explorer, select a node.
  2. Press Alt+Insert | Ctrl+N | ⌘ N.
  3. Choose Class/Interface in the context menu.

Reference

Screenshot

Method 2

  1. In the Code Editor, press Ctrl+Alt+Insert | Ctrl+Shift+A | ⌃ ⌥ N.
  2. Choose Class/Interface in the context menu.

This will add the new file in the same folder as the current file.

Reference

Screenshot

Pang
  • 9,564
  • 146
  • 81
  • 122
  • Following your reference, it seems the shortcut for adding a class from inside the editor is now Ctrl+Shift+A. This worked for me. Thanks a bunch! – anaotha Apr 11 '23 at 19:50
  • @anaotha I updated the answer to include the shortcut for the Visual Studio 2022 (Windows) keymap scheme. – Pang Jun 15 '23 at 00:59
5

There is no dedicated shortcut for a new class, but you can select a node in the Solution Explorer, press Alt+Insert, and then pick the desired template from the popup.

Dmitry Matveev
  • 321
  • 2
  • 6