我正在寻找一种方法来强制Sublime 3在保存文件或键入时从代码中为空的任何缩进行中删除所有空格和制表符。
有办法吗?
|
if (...) {
|
some code
|
}
至
|
if (...) {
|
some code
|
}
最佳答案
将此添加到您的首选项(Preferences > Settings):
"trim_trailing_white_space_on_save": true
保存文件时,这将从所有行的末尾删除空格,即使是空行也是如此。
引用默认设置文件:
// Set to true to removing trailing white space on save
"trim_trailing_white_space_on_save": false,
关于editor - Sublime 3 : Is there a way to remove tabs/spaces from empty lines?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46018598/