Auto-saving files upon changes with VSCode

3136 views visual-studio-code
-1

I have used Webstorm from JetBrains for almost 4 years now. It's a fantastic IDE for many reasons, but one of the best features is that it saves versions of files outside of version control. So if you accidentally delete files or lose files before they are saved by your VCS, Webstorm has a copy of them and there are visual diff tools to use. This feature has saved my ass on more than one occasion.

My question is - for VSCode is there some feature/plugin that will auto-save copies of files as they change? VSCode will save the files to some central location, or perhaps in the .vscode folder in the local workspace?

The feature in Webstorm is available from "Local History -> Show History" from a folder or file. Here is an article about it: https://blog.jetbrains.com/phpstorm/2012/10/using-local-history-for-code-changes-tracking/

The view looks like:

enter image description here

answered question

1 Answer

5

Yes VSCode can auto-save changes on files as you make changes. It also allows you set a delay for how long to wait before saving the file.

Here's a link that should help you with that.

Or a shortcut you can simply navigate to your VSCode settings, and add the following to your settings.json

{
    ...
    "files.autoSave": "afterDelay",
    "files.autoSaveDelay": 1000,
    ...
}

This will instruct your editor to autosave after 1000ms delay. You can set the autosave option to onFocusChange to autosave whenever you move your cursor away from the current text area.

posted this

Have an answer?

JD

Please login first before posting an answer.