IntelliJ keyboard shortcut for a particular run configuration
I have a JUnit run configuration to run all my unit tests.
How can I bind a keyboard shortcut to the run of that JUnit config?
There is now a third-party plug-in:
- Run Configuration as Action
Workarounds without plug-ins:
Use Run | Run... (Alt+Shift+F10) on Windows to quickly select the configuration to Run or Debug
Run the tests from the Ant script target, IDEA allows to assign keyboard shortcuts for the selected targets in Settings | Keymap.
You can also create a Macro and assign a shortcut to that Macro as a workaround.
- Go to Edit | Macros | Start recording macro
- Press Alt+Shift+F10 to show Run dialog
- Start typing the name of the desired Run Configuration (Just type enough to distinguish it from other run configurations)
- Press Enter to run the Run Configuration
- Go to Edit | Macros | Stop recording macro and choose a proper name for recorded macro.
- Now you can assign a keyboard shortcut to your macro from the Preferences | Keymap (Type the name of recorded macro in the search box).