IntelliJ IDEA Vim emulator smart behavior with newlines

For example, to convert:

List(
  User(1)

      

in

UserQuery ++= List(
  User(1)

      

where it is User

matched and used when forming UserQuery

.

I found it difficult to get newlines in the regex to work with the IntelliJ Vim emulator (at the bottom of the editor window after clicking and :

). In normal Wima, no.: /

IntelliJ IDEA version: 14.1.3 (I first tried this in IntelliJ IDEA and so I don't know if this is a new issue.) Platform: Mac OS X 10.10.2 (Yosemite)

+3


source to share


1 answer


I found the following to work.

For matching: use \n

. To replace: use \r

.



That is, it \n

does not work in substitution, \r

does not work in a template. This regex works:

s/List(\n\( *\)\(\w*\)/\2Query ++= List(\r\1\2/

      

+2


source







All Articles