ReSharper
 
Get ReSharper
You are viewing the documentation for an earlier version of ReSharper.

Duplicate line or selection

Last modified: 21 July 2022

ReSharper | Edit | Duplicate Text

Ctrl+D (ReSharper_DuplicateText)

One of the ways of creating a code element similar to an existing one (for example, a new method overload or a new auto-implemented property) is cloning the existing element with copy-paste and then editing the clone.

ReSharper helps you streamline the cloning part — with a single keystroke Ctrl+D the cloned code is inserted right after the original.

This feature is supported in the following languages and technologies:

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