Friday, 6 November 2015

sublime change default indentation


1. you need open you sublime first.

2. then open a js file (if you want to set indentation for js files)

3. then go to "Preferences -> Settings -> More -> Syntax Specific -> User" it will open a new file:

javascript.sublime-settings



4. Put below code in:

{
  "tab_size": 4,
  "translate_tabs_to_spaces": true
}


5.save and restart your sublime (somebody said no needs to restart. but i found my sublime have to be restarted to apply the change.)

All settings:

https://www.sublimetext.com/docs/indentation


You also can create a ".editorconfig" file under your project folder.
1. the advantage of doing this is you can upload it to github and everybody who get your project will have the same indentation settings.
2. the disadvantage of doing this is that the settings will only work when you open your whole project, which means you will not get the right indentation if you just open a single file.





http://stackoverflow.com/questions/9474090/how-do-i-force-sublime-text-2-to-indent-two-spaces-per-tab


No comments:

Post a comment