简体   繁体   中英

Sublime text change the indentation according to the file extension

I know how to change default indentation in the file: preferences of sublime text but i would like to know if it's possible to tell to sublimetext: when it's a.rb file you have to set 2 for tab size and when it's a.html you have 4 for tab size. Is it possible to make it automatic?

In your Ruby syntax settings $SUBLIME_PATH/Packages/User/Ruby.sublime-settings set tab_size = 4

{
  "tab_size": 4 // by the way it is 2 for Ruby by conventions
}

For HTML set tab_size in $SUBLIME_PATH/Packages/User/HTML.sublime-settings

{
  "tab_size": 2
}

OR you can open an HTML file and go to preferences > settings - syntax specific and sublime will open the settings file for HTML.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM