Sublime text 2 syntax based configuration file


Recently, I was learning python programming language, but I encountered a small problem. The original Ruby coding specification is indented with two spaces, so it was previously set in the global user configuration of sublime"tab_size": 2Therefore, when editing Python files, you have to set it from the menu every timetab_sizeThe size of the is 4. After searching, it is found that sublime text 2 actually supports syntax specific configuration. The specific steps are as follows:

  1. Open a Python code file first, or set the syntax of the current file to “Python”;
  2. Click “sublime text 2 – > Preferences – > Settings – more – > syntax specific – user” in the menu bar;
  3. You can see that a file named “python. Sublime setting” is opened. If the name of the opened file is not python, please go back to step 1.
  4. In the open language specific configuration file, set directly:

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

    The above settings override the global configuration by default.

The above steps refer to fromToday’s Tip: Sublime text 2 syntax indentation configuration and IPA file generation