19

Is there a way to configure RubyMine 3.1 to only use two spaces to indent JavaScript?

Dave Newton
  • 158,873
  • 26
  • 254
  • 302
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622

3 Answers3

32

Which version of RubyMine are you using?

The JetBrains site of reference for v3.1 reads as follows:

Settings dialog -> Project settings -> Code style -> General -> Indent

Indent:

In this text box, specify the number of spaces (or tabs if the Use Tab Character check box is selected) to be inserted for each indent level.

As for altering this specifically for Javascript, I don't see a possible solution - or at least not an easy one. You might be able to configure these general settings per file type, however. But I'm no expert in this field.

Grant Thomas
  • 44,454
  • 10
  • 85
  • 129
  • 4
    There are tabs for different languages in Project settings -> Code style -> General -> Tabs and Indents, including JavaScript. – Tim Down Apr 04 '11 at 15:13
5

Newer Answer:

on OSX Mavericks with RubyMine 6.3

File -> Default Settings -> Code Style -> JavaScript

The fact that this isn't under preferences is infuriating.

Joe Susnick
  • 6,544
  • 5
  • 44
  • 50
2

Updated answer from Joe:

On OSX Mavericks with RubyMine 7.1.2

File -> Default Settings -> Editor -> Code Style -> Javascript

And change the indentation settings in the 'Tab and Idents' tab.

It's pretty similar from the Joe's Answer, just adding the Editor option.

Hernan Velasquez
  • 2,770
  • 14
  • 21