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

Scratch files

Last modified: 17 March 2023

Create: Ctrl+Alt+Shift+Insert

Sometimes you may need to create temporary notes or draft up some code outside the project context. Instead of switching to a different application, you can use scratch files and scratch buffers.

  • Scratch files are fully functional files that support syntax highlighting, code completion, and all other features for the corresponding file type. For example, while working on one solution, you may come up with an idea for a method that you could later use in another solution. You can create a scratch file with a draft of the method, which is not stored in your solution directory but can be opened when you're working on any other solution. You can use scratch files to draft code constructs, HTTP requests, JSON documents, and so on.

  • Scratch buffers are simple text files without any coding assistance features. Scratch buffers can be used for simple task lists and notes to yourself. They are also not stored in the solution directory and can be opened from any other solution. You can create up to five scratch buffers with default names, which are rotated and reused by clearing the content.

By default, existing scratch files and buffers are shown in the Scratches and Consoles node in the Explorer window. If you don't use scratches, you can hide this node: click Options on the title bar and then clear the checkbox next to Scratches and Consoles

JetBrains Rider: Hide Scratches and Consoles

You can run a C# scratch file or any of its parts using C# Interactive.