打开sublime text,点击在Preferences, Settings-User打开的用户配置中加入以下一行:

"trim_trailing_white_space_on_save": true

完整的配置如下

{
    "ignored_packages":
    [
        "Vintage"
    ],
    
    "expand_tabs_on_save": true,

    "trim_trailing_white_space_on_save": true
}

此功能在保存代码时自动应用于当前编辑的文件。

保存前:

 

使用sublime保存后:

此随笔与

Sublime 保存时自动转换tab成空格

是具有关联性的文章,属于代码优化系列sublime使用技巧.

  

posted on 2015-09-06 08:43  你不知道的浪漫  阅读(2451)  评论(0编辑  收藏  举报