File --> Settings --> Code Style --> Ruby
offers a handful of options for how you'd like to format your code, but I don't see a way to set or enforce a max line width. Is this supported somewhere else, perhaps in a plugin?
I'd be okay with having the wrapping occur at specific times, such as when a code formatter is run.
You can have the editor 'soft wrap' you lines. In Preferences/Editor/General, select 'Use soft wraps in editor'. It wraps the text as a function of the width of the window in which it appears. If you expand the width, the text unwraps to fill the space. The wrapping is only intelligent in that it breaks at spaces and commas and the like. The wrapped line starts in column 1. It would be nice if would indent to the same level as the start of the line. The only way to have it do so that I know of is too manually add carriage returns where you want them to break.
I tried the 'Wrap to Column' option mentioned above. It had no effect on existing code.
I'm sure the OP has already figured this out. I'm only answering because an Internet search brought me here when I was looking for an answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With