Finding a scratch file in IntelliJ IDEA

Viewed 3477

I would like a quick way to open a given scratch file.

For example. If I have a notes.md scratch. It does not show up using:

  • cmd + n then typing notes.md
  • shift + shift then typing notes.md

The only way I know to find them is by choosing Scratches in the Project tool window as described here: IntelliJ IDEA Help. This is painfully slow. Especially given that the whole purpose of a scratch is that it is a quick place to store something.

2 Answers

In case anyone comes across this thread like I did:

You can use File > New > Import Module from Existing Sources... on the existing directory where Intellij keeps the scratch files. This will create a "scratches" module in your project, which forces indexing of its contents. In my case, they're in C:\Users\jacob.hanson\.IntelliJIdea2019.1\config\scratches. You can find the full path by right clicking an existing scratch file in the project view and choosing Show in Explorer.

It's not the prettiest solution, but it preserves the default location of the scratches and keeps from having to increase the 'Recent File' buffer limit.

scratch files will appear in your Shift Shift searches!

enter image description here

Related