Home » IntelliJ IDEA Scratches

IntelliJ IDEA Scratches

by Online Tutorials Library

IntelliJ IDEA Scratches

IntelliJ IDEA provides a Temporary Editor. In Temporary Editor, we can create a text or piece of code for search and exploration purposes. IntelliJ IDEA has two types of temporary files –

  1. Scratch File
  2. Scratch Buffer

Scratch File

The scratch files are functional, runnable and debuggable. It requires a specific language and have an extension of it.

Creating Scratch File

To create a scratch file do the following-

  • Via Shortcut Key – Ctrl + Shift + Alt + Insert. OR,
  • Go to File->New->Scratch File
  • Select the Language
  • Scratch file created in the IntelliJ installation Directory/config/Scratches Folder.

Scratch Buffer

The Scratch buffer are only used for creating and editing text. They do not require a specific language and do not have an extension of it.

Creating Scratch Buffer

To create scratch buffer do the following –

  • Via Shortcut key – Ctrl + Shift + A or click on Search Everywhere icon (Press double-Shift)
  • A popup dialog box open.
  • Type the Command Name in the Search field and press Enter

IntelliJ IDEA Scratches

  • Scratch Buffer Editor Window will open. Type desired code.

Open Available Scratches

To see the list of available scratches file and scratches buffer –

  • Go to Project Tool Window
  • Select Scratches and Consoles -> Scratches

IntelliJ IDEA Scratches

Deleting Scratches

To delete a Scratch File or Buffer do the following –

  • Go to Project Tool Window
  • Select Scratches and Consoles -> Scratches
  • Right Click the File and Choose Delete.

Changing the Language of Scratches

  • Go to Project Tool Window
  • Select Scratches and Consoles -> Scratches
  • Right Click the File and Choose Change Language <Current Language>
  • Select Desired Language.

You may also like