In Intellij IDEA how do I replace text with a new

2019-02-01 15:18发布

Say I wanted to replace all commas with commas and a new line using Intellij IDEA's replace function. What do I put in the search box? In vim I'd use &\r

10条回答
聊天终结者
2楼-- · 2019-02-01 16:02

For those looking for the old multiline replace in inteliJ with version > 15.x. It seems somewhat hidden, but if you select multiple lines > click CTRL+F, then immediately click CTRL+R you are presented with the original multiline replace.

This is working on Mac IntelliJ 2016.1.3 with ⌘+F > ⌘+R

enter image description here

查看更多
等我变得足够好
3楼-- · 2019-02-01 16:02

For Intellij Ultimate 2017.3 on Mac, command-shift-enter works

查看更多
Luminary・发光体
4楼-- · 2019-02-01 16:05

Ctrl + Shift + R while the replaced text is selected:

This works for Replace in Path (WebStorm 2018.2.3):

enter image description here

see here

查看更多
贪生不怕死
5楼-- · 2019-02-01 16:06

Use Multiline button, no Regex is needed.

edit: the multiline button is missing since IntelliJ 15, but you can enable it by clicking into the textfield and pressing Alt+Enter or Ctrl+Shift+Enter

查看更多
登录 后发表回答