Skip to main content

Paste Replace Word

  • 2 minutes to read

The Paste Replace Word feature allows you to replace an identifier under the caret with a word on the clipboard without selecting this identifier.

Note

The Paste Replace Word feature works in C#, Visual Basic, XAML, and HTML code.

How to Enable

The Ctrl+B shortcut that runs the “PasteReplaceWord” command is initially disabled. Do one of the following to enable “Paste Replace Word”:

  • Assign a different shortcut to the “PasteReplaceWord” command. For information on how to change shortcuts, refer to the following example: How to Resolve Keyboard Shortcut Conflicts.

  • Enable the Ctrl+B shortcut for the “PasteReplaceWord” command. Follow the steps below:

  1. Select the CodeRush | Shortcuts… menu item to open the Shortcuts options page.

    shortcuts-page

    Note

    CodeRush menu is placed in Visual Studio Extensions menu for Visual Studio 2019. You can restore the default CodeRush menu position in Visual Studio 2019 16.4 or later. See the following topic for more information: First Steps.

  2. Type “ctrl+b” in the search text box and enable the Ctrl+B shortcut for the “PasteReplaceWord” command.

    shortcuts-page

  3. Click OK to save this change and close the Shortcuts options page.

How to Use

  1. Copy a word to the clipboard. You can use the Smart Cut and Copy feature in C# and Visual Basic code.

  2. Place the caret in an identifier.

  3. Press Ctrl+B to replace the identifier with the word on the clipboard.

    ClipbdTools_PasteReplace

XAML Support

The following screencast demonstrates how to replace the Color property value with the value on the clipboard in XAML code:

ReplaceXAML