How to set reformat and remove unused imports upon file save( Ctrl + S) in IntelliJ version 12.2?
Asked
Active
Viewed 1,317 times
1 Answers
5
When working in IntelliJ IDEA, files are always saved automatically by the IDE. Because of that, there is no need to ever press Ctrl-S, and therefore IntelliJ IDEA does not provide a way to execute actions when files are saved.
Unused imports can be removed automatically directly as files are being edited: Settings | Editor | Auto Import | Optimize imports on the fly
Reformatting code automatically can be performed before a VCS commit; there's a corresponding checkbox in the Commit Changes dialog.
yole
- 87,251
- 17
- 245
- 186