# On-Save Actions

The R source editors offer the option to perform actions on save. If the feature is enabled, the specified actions are executed each time when the editor´s content is saved, before the source code is written to the file.

The actions can be enabled in the preferences at R > Source Editors > On-Save Actions (Open)

The actions can also be configured project-specific.

### Useful to know

#### Undo

The changes made by the actions can be undone using the regular Undo command. Undoing restores the code before saving in the editor and also saves this state to the file.

#### Local File History

In the file's local history, the versions before and after the actions are performed, are recorded.