osman
osman

Reputation: 2459

RubyMine reformatting

This is in the RubyMine IDE.

It seems really simple but I can't find a way to do it. I want to take a line

[:a, :b, :c]

and as part of the reformatting rearrange each value to one line like so:

[
  :a,
  :b,
  :c
]

And assign a nice little keyboard shortcut.

Any idea how I do this? RubyMine documentation isn't great.

Upvotes: 0

Views: 48

Answers (1)

Petraro
Petraro

Reputation: 33

Not familiar with a way to use the IDE reformatter for this need.

But, you can achieve the rearrangement using the find an replace tool (CTRL + R). Mark the regex checkbox. In the find box look for space - (). In the replace box, insert newline - \n\t. Then hit Replace all - it should do most of the job.

Upvotes: 0

Related Questions