Can we please disable format on save by default? #29395
Replies: 38 comments 19 replies
|
I just ran into this yesterday and it was quite frustrating. You might file a bug report since discussions don't seem to get much attention. |
|
Try this settings.json |
|
Format on save being "on" by default is in my opinion the worst part of Zed — it is far too invasive default for a text editor. I tested it on a TypeScript file, and without me noticing, it changed all the single-quotes to double-quotes, replaced commas with semicolons in interfaces, added whitespace changes here and there. Most of the file has been changed And it's not like I can simply revert all this now, because these modifications are mixed with my own changes. |
This comment has been hidden.
This comment has been hidden.
|
and "ensure_final_newline_on_save" "remove_trailing_whitespace_on_save" #24743 God knows what “features” I'll have to turn off before some file gets unexpectedly changed in next update. |
|
I have already set format_on_save to off, but it was useless. So I go back to vscode. |
|
Just bumped into this same issue. format_on_save is off, but this setting is not respected when we start the editor. I have to go to the settings page to turn the option on and off again. Then it works. |
|
I have problem with different formats. For example:
|
|
This is a very bad "feature". Django template language gets mangled by default. It will be a nice surprise to those who make a quick change and then later find their whole file torn apart. It is inherently a bad decision for all languages because being opinionated by default (some "better than thou" opinions) instead of preserving existing opinions never makes sense. Imagine you are working in some legacy codebase with old patterns. For this reason no one uses a global linter or formatter for any language. It is always project dependent. Thus the IDE should not have global surprise code formatting opinions. A sane option would be to have a modal pop up upon first save for a project that asks the user if they would like to use automatic formatting on save for this project with instructions on how to turn it off later. |
|
Yeah this took me by surprise. There is some mismatch between the formatter and code sniffer in PHP and it applied format changes that are immediately marked as problems! It's a reasonable feature but should 100% be off by default. |
|
Workaround 1: Disable zed silent reformatting globally.
{
"format_on_save": false,
"remove_trailing_whitespace_on_save": false,
"ensure_final_newline_on_save": false
}Workaround 2: Disable zed silent reformatting for one language, such as YAML:
{
"languages": {
"YAML": {
"format_on_save": false,
"remove_trailing_whitespace_on_save": false,
"ensure_final_newline_on_save": false
}
}Workaround 3: Disable zed silent reformatting due to one language server, such as YAML:
{
"languages": {
"YAML": {
"formatter": "language_server"
}
},
"lsp": {
"yaml-language-server": {
"settings": {
"yaml": {
"format": {
"enable": false
}
}
}
}
}
} |
|
You are really not alone |
|
This is so annoying. Please. Please |
|
OMG this makes me want to kill myself. Most modern software assumes it's the main character. But developer tools are generally better than that. For the love of god somebody on the Zed team fix this. Rethink it from the ground up. I am the programmer. Zed is not. |
|
If you go to command pallete and type "setting", it will open settings panel from there search fro "format on save" then you can disable it via GUI (the same toggle that was supposed to be on the onbaording but isn't) |
|
Huge anti-feature when dealing with yaml files that are ansible playbooks, since they often have inlined dicts in a loop context. |
|
The most annoying thing while using Zed. This should be opt-in. This feature messes up my diff every time. |
|
Absolutely the most terrible option for Zed. |
|
please |
|
Adding a vote to disable this behavior by default. I find it very hard to believe that this feature does more good than harm for the average user. |
|
Please for the love of god just disable this behavior. Imagine my surprise when I tried out this editor with a simple HTML file, and found my entire file torn apart. I also did not get that option in the onboarding screen, neither did I get the option to disable AI in the onboarding screen. This editor seems very nice under the hood, but in my opinion the onboarding experience is pretty terrible because of things like these |
|
Aarrghhh my one line commit turned into hundreds. Dodged a bullet by not pushing. |
|
I just learned about this "feature" when reading a source diff. Had to undo everything. Zed is about to get uninstalled. No default behavior in a code editor should ever re-write an entire file. |
|
This feature makes AI agents very confused since almost every edit of file touches unwanted lines, leading to back-and-forth adjustment for "repairing" them. That's a lot of wasted token. |
|
This is one of the issues that's keeping me from migrating to Zed fully. I had a YAML file with a list that had comments indented with spaces for each item to align them for readability. The formatting on save keeps only a single space before the comments, disrupting my alignment. I disabled formatting on save for YAML for this. I had also disabled "Ensure final newline on save", but the formatter for the XML extension keeps adding a new line for some reason. I had to disable formatting on save to prevent this behaviour. After that, I disabled the setting globally for all languages. Admittedly, I think my issues are with the formatter more than the "Format on save" setting. But that's only one of the many issues I have with Zed. The only changes I made to VS Code were for disabling AI features and setting the default indentation. So far, it feels like Zed has poor design choices and only got popular because of social media hype. It requires too much effort to configure for simple code-writing. |
|
I was experimenting with Zed for the first time and it just f*** up with working directory by auto formatting things. Great first and last experience. |
|
As someone else has pointed out, for me the missing piece was an "format_on_save": "off",
"ensure_final_newline_on_save": false,
"remove_trailing_whitespace_on_save": false, |


Uh oh!
There was an error while loading. Please reload this page.
One of my first experiences with Zed was trying to revert all the edits I accidentaly commited because I didn't know the editor made these changes on save without any warning (and mostly out of viewport). It added semicolons on a ton of places and I had to manually go through it to revert each one separately. This was pretty frustrating.
Generally, I really don't like when editors do this, I have my own formatting choices and I don't want the editor to do something with it unless I tell it to. I suspect I'm not alone in this, I'd be glad if editing actions were opt-in, especially if they are opinionated, like formatting.
All reactions