Is there a way to automatically reformat my code when I Save All (cmd+s) on Mac RubyMine?
I tried to bind the shortcut CMD + S to both Save All and Reformat Code but that didn't do the trick.
Thank you
Try recording a macro that involves reformatting your code and assigning a new keyboard shortcut to it.
- First go to to Edit -> Macros -> Start Macro Recording.
A small green box should appear at the bottom right-hand corner - Macro recording started...
- Go to Code -> Reformat Code.
- Go to File -> Save All.
- Go to Edit -> Macros -> Stop Macro Recording.
- Name your macro (e.g. reformat on save)
- Go to RubyMine -> Preferences -> Keymap and look for your macro (e.g. reformat on save) in the search box at the top right-hand corner.
- Right-click your macro and Add Keyboard Shortcut.
- Go with cmd + s or cntrl + s and override the existing one.
- Click Apply and OK.