Force Sublime Text Editor To Use Fixed Tab Spaces

Since I learned how to program, I always used four tab spaces to indent my code lines. The code was following the clean code principles, and I could find everything very fast. This changed after I started to work exclusively with JavaScript and I came to contact with two tab spaces. I don’t know why, but I have to say that this is very nice. Long story short: It’s now better and more effective!
Let’s return to the main topic and force the Sublime Text editor to work with two tab spaces.

You only need to extend the custom user settings of your Sublime Text configuration as following:

  "tab_size": 2,
  "detect_indentation": false

The official documentation says:

tab_size Integer, The number of spaces a tab is considered equal to

detect_indentation Boolean, if true (the default), tab_size and translate_tabs_to_spaces will be calculated automatically when loading a file

After extending the custom user config, Sublime Text will only use two tab spaces for every file you open with the editor.


Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn