将tab输入自动转换为4个空格
查看sublime text 3的默认设置(Preferences->Settings-Default)
...
// 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": false,
...
意思就是:tab的长度为四个空格大小,单数输入tab并不会将tab自动转化为四个空格;
修改方式:
将上述配置复制,黏贴到sublime text3的用户设置(Preferences->Settings-User)中
// Settings in here override those in "Default/Preferences.sublime-settings",
// and are overridden in turn by syntax-specific settings.
{
// 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
}
这样设置之后编写代码时,点击tab键,会输出四个空格;
将以前tab写的代码,改成空格缩进
对于使用tab为Indentation编写的代码,如何修改其Indentation为space?
点击sublime text 3的View->Indentation->Table Width 4
点击sublime text 3的View->Indentation->Convent Indentation to Spaces