Create scratch file from command line?

Answered

Like many Windows users, I use notepad for quick notes to myself, holding onto things I've copied, etc. It's a quick way to write down throwaway text.

A couple of days ago, I was in notepad, playing around with a code snippet I'd copied from somewhere. I found myself annoyed that I couldn't format it, jump from open brackets to close brackets, etc. And I thought "gee, this would be great in an IntelliJ scratch buffer." So I copied it, created one, and pasted it in. Happy.

That got me thinking. Could I easily use IJ scratch buffers instead of notepad? I mean, yes, I can open IJ (or switch to it), create a new scratch buffer, and paste in my text. But that's a lot more cumbersome than <Windows-R>notepad<enter><Ctrl-V>.

So I wonder. Is there a way to create a new scratch buffer from the IJ command line? If so, I could create a batch file containing the correct command line, and use it in place of "notepad" in the above sequence.

0
1 comment

Hi Rob,

You can open existing files and projects in IDEA using CLI, including scratch files, but you can't create them from outside as far as I know.

You may also find LightEdit mode useful.

0

Please sign in to leave a comment.