ReSharper Web Help

To quickly duplicate a code line or selection
  1. Position the caret at any line, or select a block of source code:

    Coding_Assistance__Duplicate_Line_Block__01

  2. On the main menu, choose ReSharper | Edit | Duplicate Text, or, alternatively, press Ctrl+D. A code duplicate will be inserted right after the original code:

    Coding_Assistance__Duplicate_Line_Block__02

Tip

This feature is especially useful in conjunction with Extend/Shrink Selection - for example, you can quickly select a method, press Ctrl+D to duplicate it, and modify the copy to create a new overload.

This feature is supported in the following languages/technologies:

C# VB.NET HTML ASPX Razor JavaScript TypeScript CSS XML XAML RESX Build Scripts
feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available

Tip

The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see the corresponding topics in the ReSharper by Language section.