Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

creating macros in intellij

I am trying to create a macro that takes a selection of text and runs some find/replace on it using a regex. I have recorded this macro in intellij, but when I run it, all I get is the find/replace dialog opened. No find/replace is executed.

Has anyone had any luck with creating a find/replace macro in intellij?

like image 991
mkoryak Avatar asked Dec 15 '09 19:12

mkoryak


People also ask

How to create shortcut in intellij?

Add a keyboard shortcutOn the Keymap page of the Settings/Preferences dialog Ctrl+Alt+S , right-click an action and select Add Keyboard Shortcut. In the Keyboard Shortcut dialog, press the necessary key combination.

What is macros in Pycharm?

Macros provide a convenient way to automate repetitive procedures you do frequently while writing code. You can record, edit and play back macros, assign a shortcut to them, and share them. Macros can be used to combine a sequence of editor-related actions within a file.


1 Answers

This appears to be a long-standing bug in IntelliJ. One workaround that worked for me was this:

  • Install the IdeaVim plugin.
  • When recording a macro requiring searching, enable Vim mode (Tools -> Vim Emulation) during the macro, position the cursor using standard Vim measures, disable Vim mode.

In general, Vim emulation can be really handy for IntelliJ macros.

like image 131
Stanislaw Osinski Avatar answered Oct 27 '22 12:10

Stanislaw Osinski