IntelliJ IDEA 14.1.0 Help

Scratches

IntelliJ IDEA provides a temporary editor. You can create a text or a piece of code for search or exploration purposes.

In this section:

Creating scratches

To create a scratch file

  1. Do one of the following:
    • On the main menu, choose Tools | New Scratch File
    • Press Ctrl+Shift+Alt+Insert
  2. Select the language of the future scratch from the list that IntelliJ IDEA suggests. IntelliJ IDEA creates a temporary editor tab.
  3. Type the desired code.

Important notes about scratches

Note the following:

  • The scratch code in scripting languages is executable: you can run and debug it.
  • Local history for scratch files is supported.
  • It is possible to perform clipboard operations with scratch files.
  • The scratch files are stored under IntelliJ IDEA home, in the directory config/scratches
  • To observe the available scratch files, do one of the following:

Closing scratches

To close a scratch file, just click close1 on the editor tab. Refer to the section Closing Files in the Editor for details.

Deleting scratches

To delete a scratch file, follow these steps:

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

Changing the language of a scratch

If you want to change the scratch's language when a scratch is already created, you can do so with the aid the widget located in the Status bar.

Click the widget, and choose the desired language from the pop-up menu:

scratch_widget

The icon of the scratch file in question changes accordingly.

Note the following:

  • The widget only shows for scratch files opened for editing.
  • You can narrow down the search of the required language by typing the letters of its name.

See Also

Last modified: 14 July 2015