How set the tab size to 2 spaces

The default tab size in ERB files is et to 4 space, how I can change for 2?


Regards,
Luiz Aguiar

1
8 comments
Avatar
Permanently deleted user

Hi Luiz,

The default tab size in ERB files is et to 4 space, how I can change for 2?

You can configure tab size at: File | Settings | Code Style | General | Tabs and Indents

Best regards,
Oleg

7
Avatar
Permanently deleted user

For IntelliJ IDEA

From the diagram above, instead of "Tools", select "Editor" > "Code Style" > [Pick a file type] ...then you will see your settings.


5

@...
I did found Code Style and I did changed the tab size to 2. 
But the space in the code is not changing

4

@... This doesn't have any effect for me.

1

The new tab size has no effect when trying to edit existing files. Applies only to new ones. Frustrating.

1
Avatar
Permanently deleted user

There is no Code Style directly in Settings. There is one in Editor, but there is no General. 

0

Could you please specify whether you're trying to work with .erb files in WebStorm or RubyMine.

0

I found a work around for the issue where changing the tab size has no effect on current files. I cut and pasted my code into another code editor, like VS Code, then I pasted it back into CLion with the new tab settings taking effect. Maybe that'll help someone.

0

Please sign in to leave a comment.