Sublime Forum

How to configure the format of JS file in Sublime text 3?

#1

Hello all,
I am new to sublime Text. I would like to format the JavaScript file with tab space as two spaces. I would like to know is there any way to configure the editor or add a configuration file which will format the file accordingly.

Thanks&Regards
Sarath U

0 Likes

#2

Have a javascript file open and go to Preferences > Settings - More > Syntax Specific Settings and add.

{
  "tab_size": 2,
}

I’d also add the “translate_tabs_to_spaces” key with a value of true so that all your tabs are space characters.

0 Likes