Reputation: 544
Is there a way to ensure the Include non-menu actions
checkbox in the Run actions window is always turned on by default?
I'm quite tired of having to press Сtrl+Shift+A twice to run a maven build (a non-menu action)!
Upvotes: 2
Views: 162
Reputation: 32046
There is not. Your best best would be to record a simple macro (Edit > Macros) and record the Ctrl+Shift+A twice. Give it a name and then map a different shortcut to it in Settings > Keymap
If you wanted to move the Ctrl+Shift+A mapping to the macro, In theory you should be to record the "Action:FindMacro" step followed by Alt+N to select the checkbox using its n accelerator. However a bug surfaced when I did that. When the macro runs, the "Open Tasks" dialog opens which is mapped to Alt+Shift+N. It appears that the when the macro interpreter sees the uppercase N, it adds a shift key to the playback. I went in and manually edited the 'N' to 'n' and that resolved the issue. (I reported the bug via IDEA-124492).
After working through that, another issue surfaced. The Alt+N sequence was getting sent too quickly. So I needed a pause between the ''Open Find Action Dialog''. Since I am unaware of a way to add a pause in a recorded macro (I opened feature request IDEA-124493 to allow such) I instead inserted a few Ctrl+A sequences as a hacked pause. Since the default behavior when opening the Find Actions dialog is for the previous search string to be selected, this does not end up changing any behavior.
If you want to use this macro, close IntelliJ IDEA. Open the file config/options/macro.xml
. (See this document to learn where the IntelliJ IDEA config
directory is.) If the file is not present, create one with the structure:
<?xml version="1.0" encoding="UTF-8"?>
<application>
<component name="ActionMacroManager">
</component>
</application>
Then in the <component>
element, insert the macro:
<macro name="Find non-menu Action">
<action id="GotoAction" />
<shortuct text="control a" />
<shortuct text="control a" />
<shortuct text="control a" />
<shortuct text="control a" />
<shortuct text="alt n" />
</macro>
Save and restart IntelliJ IDEA. You can then remap the Ctrl+Shift+A mapping to it via Settings > [IDE Settings] > Keymap > Macros.
I found on my system I needed four of the "pauses" via the Ctrl+A commands. Three was intermittently successful. So it was right on the edge of the pause needed. You may need to increase those.
Just as a side note in case it helps you, you can assign a shortcut to a maven goal.
Upvotes: 1