I have a project I started with Sublime and/or WebStorm, and now I want to switch to Atom.

The problem is whenever I save, the whole file gets reformatted and that is a big mess for git, which shows mostly all lines being modified.

I want to disable auto-format on save. Is that possible?


If you have the atom-beautify package installed, you can enable/disable auto-format on save for each supported language separately:

PreferencesPackagesatom-beautify → scroll waaay down to Language Config - LangXYZ - Beautify On Save (with LangXYZ being the language configured).

If you don't have extra packages installed, it might the whitespace package, which comes with Atom and is enabled by default: PreferencesPackageswhitespace

You can either click Disable and be done with it (I did :-)), or you can disable the package selectively via entries in your config.cson file, as documented on the package page itself.

|improve this answer|||||

"By default, JSFormat's Format on save is set to true."

If you install the JSFormat, you can disable or remove it.

With Atom v1.6.1, I remove JSFormat, and it won't auto format when saving JavaScript files.

|improve this answer|||||

By default, Atom cleans up the whitespaces when you save a file.

To prevent this default behavior, you have to follow these steps:

  • Go to Preferences ... (Command + ',' in macOS)
  • Click on Open Config Folder
  • Open config.cson
  • Append the following lines to the bottom of it:

whitespace: removeTrailingWhitespace: false

|improve this answer|||||
  2. Type "Application Open your Config" , hit enter
  3. Paste

"whitespace": removeTrailingWhitespace: false

enter image description here

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.