Search code examples
javascriptcode-formattingaptana3

How can I set the maximum number of columns in Aptana Studio 3?


I use Aptana 3 for web development. I was asked to keep code lines shorter than 80 columns, both for my .js and html files. I tried to configure the built-in formatter and editor but all I can do is set a limit for coloring, while I'd like to actually wrap lines. I'd like to know if I can do this easily, within Aptana or using an external formatter. Thanks in advance!


Solution

  • You can show a vertical line at whatever column number you choose by going into Window > Preferences > General > Editors > Text Editors and checking the box 'Show print margin' - there is a box here to say what column number you would like it at. This will not cause text to automatically wrap, however.

    I am not sure you want to turn on text wrapping, as this would not help with keeping your lines less than 80 columns wide for anyone who picks up your code outside of your environment, and I don't think you would want Aptana automatically adding returns when you get to 80 columns either, since this would likely destroy your code if you are not paying attention.

    You can enable word wrap under Window > Preferences > Aptana Studio > Editors by checking 'Enable word wrap' and restarting Aptana. But like I said, this will not affect your code, so it wouldn't fulfill any requirement by your client to keep code to 80 columns.