Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 727
JavaRocky Avatar asked Jun 27 '10 02:06

JavaRocky


People also ask

What is the shortcut for run in IntelliJ?

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.

How do I change the shortcut for run in IntelliJ?

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.

What is Ctrl K in IntelliJ?

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.

What is Ctrl Shift O in IntelliJ?

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.


3 Answers

There is now a third-party plug-in:

  • Run Configuration as Action

Workarounds without plug-ins:

  1. Use Run | Run... (Alt+Shift+F10) on Windows to quickly select the configuration to Run or Debug

  2. Run the tests from the Ant script target, IDEA allows to assign keyboard shortcuts for the selected targets in Settings | Keymap.

like image 82
CrazyCoder Avatar answered Oct 02 '22 10:10

CrazyCoder


You can also create a Macro and assign a shortcut to that Macro as a workaround.

  1. Go to Edit | Macros | Start recording macro
  2. Press Alt+Shift+F10 to show Run dialog
  3. Start typing the name of the desired Run Configuration (Just type enough to distinguish it from other run configurations)
  4. Press Enter to run the Run Configuration
  5. Go to Edit | Macros | Stop recording macro and choose a proper name for recorded macro.
  6. Now you can assign a keyboard shortcut to your macro from the Preferences | Keymap (Type the name of recorded macro in the search box).
like image 44
Nader Ghanbari Avatar answered Oct 02 '22 10:10

Nader Ghanbari


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. enter image description here

It works for all Jetbrains IDEs based on IntelliJ platform: CLion, PyCharm, PhpStorm, etc.

like image 31
turbanoff Avatar answered Oct 02 '22 12:10

turbanoff