Easily use temporary files in Jetbrains (Scratch Files)
Table of Contents
Recommended basics: Articles you should know
To get the full picture of this article, you should know about this topics:
As developers we work with a lot of files. Mostly they are related to our codebase but sometimes we need to edit something for a short period of time in our IDE. For sure we can just create a new file in our source folder but that is not what we really want to do. We can do better.
What are scratch files? #
Scratch files are like any other file in your IDE except that they are in the “Scratch files” section, instead of your project files.
What types of scratch files can be created? #
You can create scratch files in any format, including JSON, Python, JavaScript, Markdown, … “Scratch files” is no type, but can be seen as a special folder location.
How to create scratch files? #
You can just right-click the scratch file main folder and select New > Scratch File
. There’s also a Shortcut for it.
Cross-project scratch files #
Scratch files are unrelated to your current project, they are cross-project. Whatever scratch file you create, you will see it in any project you open with that IDE.
Also scratch files will be persistent until you delete them yourself.