Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding a scratch file in IntelliJ IDEA

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.

like image 899
MrQBerrt Avatar asked May 18 '17 16:05

MrQBerrt


People also ask

Where is scratch stored?

Similar to the Fast File system above, the scratch file system is available on the path /fh/scratch on SciComp supported Linux systems, \\center.fhcrc.org\fh\scratch on Windows, and smb://center.fhcrc.org/fh/scratch on Mac. There is no charge to the investigator for data stored here.

Which directory is used for holding scratch files?

Tip: Scratch files and buffers are stored in the IDE configuration directory under scratches. They are available from any IDE and project that uses this configuration directory.


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

like image 173
jacob.hanson1010 Avatar answered Oct 24 '22 18:10

jacob.hanson1010


I've run into the same problem and have tried increasing the file limit to a ridiculously high number, but I was feeling that contributed to sluggish behavior as the buffer grew.

Since then, I've discovered the Scratch plugin by dkandalov which has much better scratch file management (albeit using an entirely different implementation?).

https://plugins.jetbrains.com/plugin/4428-scratch

like image 29
Michael Vu Avatar answered Oct 24 '22 16:10

Michael Vu