1 下载地址:
https://www.sublimetext.com/2
Sublime Text 2.0.2 (此版本选择了 portable version),直接解压就可以使用。
https://download.sublimetext.com/Sublime Text 2.0.2.zip
2 配置Python相关环境 (前提 Pyhon 已加入环境变量)
2.1 新建 py 文件,打印中文 (print('你好')),出现错误,Decode error - output not utf-8,
解决办法:
修改Python.sublime-build配置文件,添加如下行:
"encoding":"cp936" (注意在上一行结束加逗号)
Python.sublime-build文件位置:
Sublime Text 2.0.2\Data\Packages\Python\Python.sublime-build
{
"cmd": ["python", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"encoding":"cp936",
"selector": "source.python"
}
2.2 将Tab键自动替换为4个空格
将 Preferences.sublime-settings 文件中 "translate_tabs_to_spaces": 改为 true。
// The number of spaces a tab is considered equal to
"tab_size": 4,
// Set to true to insert spaces when tab is pressed
"translate_tabs_to_spaces": true,
说明:
Preferences.sublime-settings文件位置:
Sublime Text 2.0.2\Data\Packages\Default\Preferences.sublime-settings
参考:
https://blog.csdn.net/qq_23934063/article/details/71427930