Home > Development Tools > sublime > body text

Sublime Text 2 syntax-based configuration files

藏色散人
Release: 2019-09-23 11:39:54
forward
2521 people have browsed it

The following column of sublime usage tutorial will introduce to you the issues regarding the syntax-based configuration file of sublime text 2.

Sublime Text 2 syntax-based configuration files

I have been learning the Python programming language recently, but I encountered a small problem. It turns out that Ruby’s coding specification is indented with 2 spaces, so I used to use Sublime "tab_size": 2 is set in the global user configuration, so when editing a Python file, the tab_size size must be set to 4 from the menu every time.

After searching, I found that Sublime Text 2 actually supports syntax-specific configuration. The specific steps are:

1. First open a Python code file, or set the current file The syntax is "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 and check the first step.

4. In the opened language-specific configuration file, directly set:

{ "tab_size": 4, "translate_tabs_to_spaces": true }
Copy after login

The above settings will override the global configuration by default.

The above is the detailed content of Sublime Text 2 syntax-based configuration files. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template