Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Sublime Text 2 how to configure files based on syntax

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how to configure Sublime Text 2 files based on grammar. I hope you will learn a lot after reading this article. Let's discuss it together.

Recently in learning the Python programming language, but encountered a small problem, that is, the original Ruby coding specification is indented with 2 spaces, so the previous global user configuration in Sublime set "tab_size": 2, so when editing Python files every time from the menu to set the size of tab_size to 4.

Later, after a search, it was found that Sublime Text 2 actually supports syntax-specific configuration, the specific steps are:

1. Open a Python code file first, or set the syntax of the current file to "Python"

two。 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 open language-specific configuration file, directly set:

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

The above settings override the global configuration by default.

After reading this article, I believe you have a certain understanding of Sublime Text 2 based on grammar configuration files, want to know more about it, welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report