Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resharper shortcuts for new file template

I am used to create new files in Visual Studio/Resharper with AltREN and then C for class, S for struct, T for test etc. (this is the same as the menu Resharper/Edit/New From template)

The last step stopped working when I updated to Resharper 9.

Is there a way to restore the old behaviour or is there a new shortcut available.

I tried to rename the template &Class but it didn't help.

like image 220
adrianm Avatar asked Feb 12 '15 14:02

adrianm


People also ask

How do I create a new template file?

To start a new document based on your template, on the File menu, click New from Template, and then select the template you want to use.

Where are ReSharper templates stored?

All predefined templates are stored in the ReSharper installation. All necessary modifications, including deletion of predefined templates, are saved in settings layers.

What is code template?

Code Templates are reusable code snippets that allow you to quickly insert commonly used code fragments or surround given code fragment with a meaningful code block (example: try-catch statement).

Which is a predefined template to insert or surround existing code with common data?

Telerik® JustCode™ comes with a number of predefined templates to insert or surround existing code with common data structures and statements.


2 Answers

In Visual Studio with ReSharper 9.0+:

Tools > Options > (Sidebar) Environment > Keyboard

Then:

Show commands containing:

resharper.resharper_template

These are the templates listed in the New from Template dynamic menu. By default, Class is the first template in this list (Template00). To assign a shortcut key to the first template in the list:

  1. In this location, highlight ReSharper.ReSharper_Template00.
  2. Choose an option under Use new shortcut in: (I chose Solution Explorer).
  3. Use the Press shortcut keys: to assign a shortcut key combination and click Assign to save it.
like image 162
Evan Mulawski Avatar answered Oct 11 '22 01:10

Evan Mulawski


in 2017 version use the Ctrl+Alt+Insert keyboard shortcut -> choose class -> to insert a class

ref: https://www.jetbrains.com/help/resharper/2017.1/Templates__Applying_Templates__Creating_Files_from_Templates.html

like image 41
Ram Avatar answered Oct 11 '22 03:10

Ram