Sublime Forum

Ruby autoindent should follow 2-space standard

#1

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.

Thoughts?

0 Likes

#2

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. :frowning:

0 Likes