Atom text editor remove trailing whitespace on save

ぐ巨炮叔叔 提交于 2019-11-28 04:14:38

Under your Atom Preferences go to Packages tab and search for whitespace. Click on the whitespace package and uncheck Ensure Single Trailing Newline option

On global level this can be changed using settings in Whitespace package, but if you want to disable it for a specific language you have to use syntax-scoped properties in your config.cson.

'.text.html.php': # php overrides
  whitespace:
    ensureSingleTrailingNewline: false
    removeTrailingWhitespace: false

'.source.ruby': # ruby overrides
  whitespace:
    ensureSingleTrailingNewline: false
    removeTrailingWhitespace: false

To see the scope of language go to Packages tab and search for your language.

Click on the settings of the language package and you can see the scope:

Pattycake Jr

Go to packages and find "whitespace", go to it's settings and uncheck the last checkbox.

Settings

Checkbox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!