Using Scratch Files and Buffers in IntelliJ IDEA: A Practical Guide
This article introduces IntelliJ IDEA’s Scratch files and Scratch buffers, explaining how they provide temporary, fully‑featured code or note containers that improve development efficiency by eliminating the need to switch between multiple tools.
When developing in IntelliJ IDEA you may need a quick place to write pseudo‑code, JSON, HTML, CSS, SQL, HTTP requests or temporary notes without opening another editor.
IntelliJ IDEA provides the “Scratch files” (and “Scratch buffers”) feature, which creates temporary files that are not tied to any project but are stored locally and can be accessed from any opened project.
What are Scratch files?
Scratch files are fully‑featured, runnable and debuggable files with syntax highlighting, code completion and other language‑specific features. They are stored outside the project directory, typically under an IDEA folder on the C: drive.
Scratch buffers are simple text files without language assistance, useful for quick notes or task lists. Up to five buffers (buffer1.txt … buffer5.txt) are available; creating more overwrites the oldest unless you rename them.
How to create a Scratch file
Create scratch file
Menu: File → New → Scratch File
Shortcut: Ctrl+Alt+Shift+Insert
Select code/content and press the shortcut; IDEA will infer the language and create an appropriate temporary file.
The file list shows the available types you can create.
Create scratch buffer
There is no dedicated menu item; use the Find Action (Ctrl+Shift+A) and type “new scratch buffer”.
Buffers are named buffer1.txt … buffer5.txt; the limit is five files, after which the oldest is overwritten unless renamed.
Features
Supports most language files with syntax highlighting and recognition.
Runnable and debuggable via the left‑hand icon.
Local history for rollback and content rewriting.
Cross‑project access, rename, move, delete, copy, etc.
These capabilities help avoid switching between multiple applications and improve development efficiency.
Java Architect Essentials
Committed to sharing quality articles and tutorials to help Java programmers progress from junior to mid-level to senior architect. We curate high-quality learning resources, interview questions, videos, and projects from across the internet to help you systematically improve your Java architecture skills. Follow and reply '1024' to get Java programming resources. Learn together, grow together.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.