I want to be able to execute the following in a batch when pressing cmd + s
--Delete unnecessary import statements --Organize the order of import statements --Only changes that have not been checked in to the repository --Save the code
Press cmd + opt + shift + l to display the "Reformat File dialog" Set Scope to "Only VCS changed text", check Optional "Optimize imports", and press "Run"
"Only VCS changed text" can only be set if the project is versioned and there are local changes, so if it is grayed out, check if it is a versioned project and if there are any changes locally. To do.
Press Editor-> Macros-> Start Macro Recording and then do the following:
Press Editor-> Macros-> Stop Macro Recording, then save macro as
Preferences-> Keymap-> Macros-> Click on the saved macro-> Add Keyboard Shortcut Enter "cmd + s" and OK