j2emanue
j2emanue

Reputation: 62519

Intellij scratch files - how to delete them?

I have created a few scratch files in android studio (fork of Intellij). by going to tools-->new scratch file.

But now i have soo many scratch files and i dont know how to delete them since they auto save. Can anyone help ?

Some info: scratch files are used to prototype code without it actually mingling with your exisiting code. Its like a notepad which auto saves.

Upvotes: 7

Views: 5414

Answers (3)

Erik Finnman
Erik Finnman

Reputation: 1667

It's also possible to have the file deleted automatically by clearing the content before the tab is closed:

IntelliJ IDEA numbers scratch files sequentially starting from 1. If you close a tab with an empty scratch file, IntelliJ IDEA deletes it.

https://www.jetbrains.com/help/idea/scratches.html#create-scratch-buffer

Upvotes: 2

Muhammed Thasneem
Muhammed Thasneem

Reputation: 99

Switch to the Scratches view of the Project tool window.

  1. Switch to the Scratches view of the Project tool window.
  2. Under the Scratches pseudo-folder, right-click the scratch to be deleted, and choose Delete on the context menu.
  3. Confirm deletion.

enter image description here

Upvotes: 3

matmo
matmo

Reputation: 1379

To delete a scratch file or buffer, follow these steps:

  1. Switch to the Scratches view of the Project tool window.
  2. Under the Scratches pseudo-folder, right-click the scratch to be deleted, and choose Delete on the context menu.
  3. Confirm deletion.

Source: https://www.jetbrains.com/help/idea/15.0/scratches.html?origin=old_help#d640596e253

I was also able to do it by pressing cmd+E (for mac) to open the recent files popup. Then select the line and hit the delete key.

Upvotes: 16

Related Questions