Skip to main content

Easily use temporary files in Jetbrains (Scratch Files)

·2 mins
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.

scratch files main folder

Do you use an IDE already?

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.

how to create scratch files

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.

Oliver Lippert
Author
Oliver Lippert
I care for details. I think about functions and their meaning. What should they do, what not? I think about variable names. I read commit messages. All this with long-term thinking. It’s easy to write code today, but Projects get harder as longer they run. This drives me in many discussions and code reviews. +15 Years of experience has told me a lot. I reflect that mindest in business discussions as well.