Home Download Buy Blog Forum Support

Ruby autoindent should follow 2-space standard

Ruby autoindent should follow 2-space standard

Postby chipadeedoodah on Sun Apr 07, 2013 10:13 pm

Sublime Text out of the box uses a single tab for all Ruby autoindents. I propose setting the default indent handling for Ruby syntax in Sublime Text to a two-space indent, with automatic translate-tabs-to-spaces.

While there is no official Ruby style guide document similar to the Python document, the Ruby community has universally agreed upon the two-space soft indent as standard for all Ruby code, including Rails, rspec, etc. This is documented in every community-generated Ruby style guide.

Every style guide in the front-page google search endorses two spaces, and this list is by no means inclusive:There is zero community contention around this rule.

While this is easy enough to override myself, the default setting of the editor to one-tab is really a de facto standard of its own, and it makes passing code linting difficult for newbies who might want to contribute to projects. I know it's a bikeshed but I think it causes enough inconvenience to be filed as a bug rather than a feature request.

Posts: 1
Joined: Sun Apr 07, 2013 9:54 pm

Re: Ruby autoindent should follow 2-space standard

Postby jguice on Sun Jul 07, 2013 6:17 pm

Wow, *crickets*…

Agreed. Are these the settings you are recommending?

"tab_size": 2
"translate_tabs_to_spaces": true

For now I guess I'll just have to add them to my user settings. :(
Posts: 1
Joined: Sun Jul 07, 2013 6:13 pm

Return to Technical Support

Who is online

Users browsing this forum: No registered users and 11 guests