Search code examples
intellij-ideakeyboard-shortcuts

Speed up keyboard macro execution in Intellij?


Intellij keyboard macros are nice, but also are terribly slow and I wonder if anything can be done to improve it. I have a keyboard macro defined to format the current block of code:

   <macro name="reformat block macro">
      <action id="ToggleBookmark9" />
      <action id="EditorCodeBlockEnd" />
      <action id="EditorToggleStickySelection" />
      <action id="EditorCodeBlockStart" />
      <action id="EditorLineStart" />
      <action id="EditorLineStart" />
      <action id="ReformatCode" />
      <action id="GotoBookmark9" />
      <action id="ToggleBookmark9" />
    </macro>

When running this, it is like watching a slow typing person perform the steps, since each action is rendered. Is there a way to speed this up, some hidden switch to avoids the live rendering of intermediate steps?


Solution

  • You can change the macro command execution delay in the registry. Press ShiftShift and type "Registry" or press CtlAltShift/, find the actionSystem.playback.typecommand.delay key, and change the value from the default 200ms to a smaller value.

    Also, a word of warning: I've experienced non-deterministic macro playback behavior when setting the delay too low.