Cut, Copy, Paste
Apart from standard cut, copy, and paste operations, you can copy file paths, symbol references, and so on. When pasting, you can optionally choose items from clipboard history and automatically apply formatting rules.
Cut line or selection
Set the caret anywhere in the line to cut the whole line, or make a selection to cut.
Do one of the following:
From the main menu, choose
.Press Ctrl+X.
Click Cut on the toolbar.
Right-click the selection and choose Cut from the context menu.
Copy line or selection
Set the caret anywhere in the line to copy the whole line, or make a selection to copy.
Do one of the following:
From the main menu, choose
.Press Ctrl+C.
Click Copy on the toolbar.
Right-click the selection and choose Copy from the context menu.
When cutting and copying text from the editor, by default JetBrains Rider puts it as rich-text in the clipboard.
Copy selection as plain text
If you want to always copy editor selection as plain text, choose the corresponding option under Rich-Text Copy on the Editor | Code Editing page of the IDE settings Ctrl+Alt+S.
If you want to have rich-text copy by default, you can make a single plain-text copy by right-clicking the selection and choosing Copy as Plain Text from the context menu.
Copy the path to a file or folder
Open the desired file in the editor or select one or more files or folders in the Solution Explorer.
Do one of the following:
Right-click the file tab in the editor and choose
from the context menu.Choose
from the main menu.
In the popup that opens, choose what part of the path you want to copy — file name, absolute, or relative path.
To copy the absolute path, you can also press Ctrl+Shift+C.
Copy the reference to a line or a symbol
Place the caret at the desired symbol or at a certain line of code.
Do one of the following:
Press Ctrl+Alt+Shift+C.
From the main menu, choose
.From the context menu, choose
.
JetBrains Rider creates a string in the format that depends on the caret position. Lines are referenced by the file system path relative to the solution and the line number, symbols are referenced by their Fully Qualified Name (FQN). For example:
System.Web.Mvc.ActionResult
for a type orWebApplication1\Controllers\HomeController.cs : 21
for a code line. When your caret is on a type, you will also be able to choose alternative references from a popup:
Copy editor tooltip contents
Hover the mouse pointer over a symbol in the editor to see the full symbol name and its description if available.
Hold Alt and click the tooltip.
When pasting C# and VB.NET code from the clipboard, JetBrains Rider behaves depending on the state of the Auto-format on paste selector on the page of JetBrains Rider settings Ctrl+Alt+S.
This selector lets you configure whether to apply code formatting rules for pasted code. By default, JetBrains Rider only applies indentation settings when you paste code, which is a convenient option if you do not want to follow formatting rules very strictly.
Paste the last clipboard entry
Set the caret to the place where you want to paste the last clipboard entry or select a code block that you want to replace with the clipboard entry.
Do one of the following:
From the main menu, choose
.Press Ctrl+V.
Click Paste on the toolbar.
Alternatively to pasting with the selected formatting preference, you can insert the clipboard entry with its original formatting.
Paste the last clipboard entry with original formatting
Set the caret to the place where you want to paste the last clipboard entry or select a code block that you want to replace with the clipboard entry.
Do one of the following:
From the main menu, choose
.Press Ctrl+Alt+Shift+V.
You can also access your clipboard history and quickly paste any of the recent items copied to the clipboard. JetBrains Rider starts recording copied items to its clipboard history as soon as you start it and clears the history when you close it.
Paste specific entry from the clipboard history
Set the caret to the place where you want to paste the last clipboard entry or select a code block that you want to replace with the clipboard entry.
Press Ctrl+Shift+V or choose
from the main menu.In the Choose Content to Paste dialog, you can choose one of the recent clipboard entries and preview it.
Click Paste or Pate without formatting to paste the desired entry in a corresponding way. Alternatively, press a mnemonic key displayed next to the desired entry to quickly insert it.
Smart paste
JetBrains Rider helps you automatically escape illegal characters in text that you copy/paste around your code.
If the pasted text contains characters that are illegal for the current context JetBrains Rider displays a popup suggesting to escape all illegal characters. To accept this suggestion, press Alt+Enter or press Esc to reject it.
For example, when you paste a piece of text that contains double quotes into a string literal, JetBrains Rider suggests to automatically escape all the quotes:
Another example is pasting a piece of code with generics into an XML doc tag: JetBrains Rider will replace angle brackets with corresponding escape sequences.
When pasting text inside comments, JetBrains Rider will escape */
when pasted into multiline comments and replace newlines with indent and //
or ///
when pasted into line or XML-doc comments.