45

Some months ago I observed that angular-cli or Visual Code is saving my files after short delay. Which causes recompiling a project and refreshing a page. It is useful but frustrating a bit to wait couple of seconds every single time for refresh. Even after just opening a file.

starball
  • 20,030
  • 7
  • 43
  • 238
Paweł Stolka
  • 499
  • 1
  • 4
  • 10
  • See VS Code documentation https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save – Michael Freidgeim May 13 '20 at 01:40
  • opposite question for enabling: https://stackoverflow.com/q/53181761/11107541. I'm tempted to close as a duplicate (and maybe first rephrase that one as asking how to toggle)... not sure what to do. – starball Aug 26 '23 at 22:19

5 Answers5

45

Go to File-> Preferences ->settings

choose your auto save option from commonly used settings enter image description here

Alex Varghese
  • 2,000
  • 16
  • 17
25

As @Alex Varghese mentioned in his answer you can do it in the settings. One addition is even if you turn off the auto save option in your user settings, that will not over write the option you have under Workspace settings, so you have to do the changes there as well.

enter image description here

enter image description here

enter image description here

You can also do this changes by going to the settings.json which usually resides at C:\Users\user\AppData\Roaming\Code\User.

"files.autoSave": "off"

To edit your Workspace settings, you need to edit the settings.json file which resides at the .vscode folder of your solution.

"files.autoSave": "off"
Sibeesh Venu
  • 18,755
  • 12
  • 103
  • 140
  • Of course, it is obvious if you use these both options in daily work and you know what to check. This was a puzzle for me for quite a long time. But I appreciate your effort ;) – Paweł Stolka Apr 24 '19 at 15:00
9

Vscode version 1.34 onwards just got to file menu and click on "Auto Save" to enable or disable Autosave.

Ravi S. Singh
  • 617
  • 8
  • 15
8

Instead of completely disable autosave I prefer just increase delay and save it, e.g. after 10 min. You have a full control when to save it manually, but if you forget, it will save it after the specified long period.

Files: Auto Save : Controls auto save of dirty files.
afterDelay

Files: Auto Save Delay : Controls the delay in ms after which a dirty file is saved automatically. Only applies when Files: Auto Save is set to afterDelay.
600000

See VS Code documentation

Michael Freidgeim
  • 26,542
  • 16
  • 152
  • 170
0

Vscode has an option in file menu and click on "Auto Save" to enable or disable Autosave.

Here is the Image for details Images

Engr.Aftab Ufaq
  • 3,356
  • 3
  • 21
  • 47