CLion provides a temporary editor. You can create a text or a piece of code for search or exploration purposes.
In this section:
To create a scratch file
- Do one of the following:
- On the main menu, choose
- Press Ctrl+Shift+Alt+Insert
- Select the language of the future scratch from the list that CLion suggests. CLion creates a temporary editor tab.
- 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 CLion home, in the directory
- To observe the available scratch files, do one of the following:
To close a scratch file, just click on the editor tab. Refer to the section Closing Files in the Editor for details.
To delete a scratch file, follow these steps:
- Switch to the Scratches view of the project tool window.
- Under the
Scratchespseudo-folder, right-click the scratch file to be deleted, and choose Delete on the context menu.
- Confirm deletion.