How to Use Auto Save with After Delay in Microsoft Visual Studio Code

What is Auto Save?

By default, VS Code requires an explicit action to save your changes to disk, ⌘S. However, it’s easy to turn on Auto Save, which will save your changes after a configured delay or when focus leaves the editor. With this option turned on, there is no need to explicitly save the file. 

code.visualstudio.com

Normally, you have to save a file (Click on File > Save, or Cmd-S, or Ctrl-S) before your changes are saved to the disk.

Many people prefer this. They like to control when a file is saved.

I prefer to have my file saved automatically to the disk. This means I do not forget to save. Also, with Live Server or PHP Server, it makes changes I do to a webpage more visual and dramatic for me.

How to Use Auto Save

Go to settings. Auto Save is in the Commonly Used section.

If you set Auto Save to off, changes to your file are not automatically saved. You will have to manually save your file.

Mac VSCode autoSave Off Commonly Used

I prefer to set Auto Save to afterDelay. When you make changes to your file, Visual Studio Code will wait a set amount of time, then VS Code will save the file for you. This delay is typically 1000mS, or 1 second.

If you want to change the length of the delay, enter autosave into the Search Settings field.

Of course, Files: Auto Save needs to be set to afterDelay. The Files: Auto Save Delay field contains the number of milliseconds VS Code will delay before saving. 1000 milliseconds is 1 second. Change this value as desired. I personally like the default 1 second; other people prefer 600mS.

Mac VSCode autoSave afterDelay autoSave

Now you know how to use the afterDelay Auto Save feature.

Resources

Save / Auto Save

Scroll to Top