在ST3中,我希望始终使用空格而不是制表符作为缩进。
我把这些放在我的设置中:
"translate_tabs_to_spaces": true,
"convert_tabspaces_on_save": true, // for a plugin
"detect_indentation": false,
"tab_size": 4设置convert_tabspaces_on_save用于强制转换选项卡->空格(至少在文件上使用插件ExpandTabsOnSave保存)。
但是无论如何,ST3总是使用制表符而不是空格来缩进新打开的文件。
它是一个错误还是我使用了错误的设置?
提示:每当我间接修改文件Preferences.sublime-settings时,例如使用命令Package Control: Disable Package,它都是用制表符而不是空格保存的。
发布于 2015-05-03 20:50:35
根据文档,这些设置应该起作用(它们对我有用):
{
// Integer. The number of spaces a tab is considered equal to
"tab_size": 4,
// Boolean, if true, spaces will be inserted up to the next tab stop when tab is pressed, rather than inserting a tab character
"translate_tabs_to_spaces": true,
// Boolean, if true (the default), tab_size and translate_tabs_to_spaces will be calculated automatically when loading a file
"detect_indentation": true,
// Boolean, If translate_tabs_to_spaces is true, use_tab_stops will make tab and backspace insert/delete up to the next tab stop
"use_tab_stops": true
}如果这不起作用,试着禁用所有插件,重新启动并查看问题是否仍然存在。如果不是,它就是其中一个插件(或者几个相互冲突的插件)。您可以通过一次启用一个问题并寻找问题再次出现来找出答案。
发布于 2019-03-27 06:14:05
尝试如下:使用空格查看 -> 缩进 -> 缩进
发布于 2015-04-24 10:50:04
有一些麻烦,但否则-我希望使用制表符,但sl3插入空格。它的行为只有css/scss文件!我的user.config:
{
"font_size": 11,
"ignored_packages":
[
"Vintage"
],
"tab_size": 2,
"translate_tabs_to_spaces": false,
"convert_tabspaces_on_save": false,
"word_wrap": "false"}
https://stackoverflow.com/questions/28189465
复制相似问题