Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replacing a string in Rubymine with a string with newlines

Tags:

rubymine

I want to use the Search and Replace dialogue in Rubymine, or something similar to replace something like "Scenario:" with "@Desktop\nScenario"

I'm trying to replace every instance of Scenario: in a large Cucumber test suite with

@desktop 
Scenario:

Any best ways to do this?

like image 799
David West Avatar asked Jun 08 '26 14:06

David West


1 Answers

Update:

Thanks to @ryan2johnson9 comment, I realise there's now an easier option (tested on 2017.3).

By clicking on the "New Line" (or using the shortcut Ctrl+Shift+Enter / Alt+Enter), the input becomes multilines.

New line Multiline


Original Answer

In the search and replace box, if you tick the "Regex" option you can do:

Search: "Scenario:" Replace by: "@desktop\nScenario:"

The only trick is to tick the "Regex" option :)

like image 169
ouranos Avatar answered Jun 11 '26 23:06

ouranos