Reprinted: https://www.cnblogs.com/passedbylove/p/4784426.html
Open sublime text, click to add the following line in the user configuration opened in Preferences, Settings-User:
“trim_trailing_white_space_on_save”: true
The complete configuration is as follows
{
"font_face": "微软雅黑",
"font_size": 17,
"ignored_packages":
[
"Vintage"
],
"trim_trailing_white_space_on_save": true
}
This function is automatically applied to the currently edited file when saving the code.