[英]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.
我已经在 intellij 中记录了这个宏,但是当我运行它时,我得到的只是打开了查找/替换对话框。 No find/replace is executed.
不执行查找/替换。
Has anyone had any luck with creating a find/replace macro in intellij?有没有人在 intellij 中创建查找/替换宏很幸运?
I can't get get the macro find/replace to work either but I can give you two things that might solve your problem:我也无法让宏查找/替换工作,但我可以给你两件事可能会解决你的问题:
If it is only a few places/times you need to do it find/replace has memory of earlier replacements (arrow down in search/replace fields).如果它只是几个地方/时间你需要做它查找/替换有早期替换的记忆(搜索/替换字段中的向下箭头)。
Write a plugin (yes seriously it is not hard at all) to do this.编写一个插件(是的,这并不难)来做到这一点。 I was surprised how easy it was, even though the documentation could be improved.
我很惊讶它是多么容易,即使文档可以改进。
And a bonus way of doing it, I just thought of:还有一个额外的方法,我只是想到:
This appears to be a long-standing bug in IntelliJ.这似乎是 IntelliJ中长期存在的错误。 One workaround that worked for me was this:
对我有用的一种解决方法是:
In general, Vim emulation can be really handy for IntelliJ macros.一般来说,Vim 仿真对于 IntelliJ 宏来说真的很方便。
如果一切都失败了,你可以尝试AutoIT 、 AutoHotKey 、 Applescript或其他通用宏系统。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.