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:
Select the CodeRush | Shortcuts… menu item to open the Shortcuts options 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.
Type “ctrl+b” in the search text box and enable the Ctrl+B shortcut for the “PasteReplaceWord” command.
Click OK to save this change and close the Shortcuts options page.
How to Use
Copy a word to the clipboard. You can use the Smart Cut and Copy feature in C# and Visual Basic code.
Place the caret in an identifier.
Press Ctrl+B to replace the identifier with the word on the clipboard.
XAML Support
The following screencast demonstrates how to replace the Color property value with the value on the clipboard in XAML code: