Search code examples
rubymine

How to make RubyMine align equations neatly?


In RubyMine, I have some code in this form:

a = b
cd = e
fgh = i

I would like it to auto-format to something like this:

a   = b
cd  = e
fgh = i

Does anyone know whether this is possible (or I have to keep doing it by hand), and if so how I could set it up? Thanks in advance!


Solution

  • Preference -> Editor -> Code Style -> Ruby -> Other -> ✓Align right parts of assignments or hashes

    Then Code -> Reformat Code manually.

    enter image description here