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?
Ctrl Ctrl. We can run anything from anywhere by pressing the Ctrl key twice. No matter where we are in the IDE or which file is open, if we double tap Ctrl the Run Anything window opens. By default, this shows a list of recently run configurations.
Configure keyboard shortcuts IntelliJ IDEA includes several predefined keymaps and lets you customize frequently used shortcuts. To view the keymap configuration, open the Settings/Preferences dialog Ctrl+Alt+S and select Keymap. IntelliJ IDEA automatically suggests a predefined keymap based on your environment.
I think Android Studio/IntelliJ doesn't play that well, for me, I changed Android Studio Keymap to Eclipse as I used to (My collection tips) and to use Ctrl + K , I press search the string first: Select the text we want to search. Press Ctrl + F , Enter. Then can use: Ctrl + K in any file we are on.
In Eclipse, you press CTRL + SHIFT + O “Organize Imports” to import packages automatically. For IntelliJ IDEA, if you press CTRL + ALT + O “Optimize Imports”, it just removes some unused imports, never imports any package.
There is now a third-party plug-in:
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.
I've created plugin for this Run Configuration as Action.
After loading of this plugin it register all Run/Debug configurations as actions. So you can assign shortcut for them, add them to toolbars, etc.
It works for all Jetbrains IDEs based on IntelliJ platform: CLion, PyCharm, PhpStorm, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With