Essential VS Code settings
Auto Save
You already know the importance of saving your work frequently to avoid losing progress.
But with the workflow you’ll be using for the assignments, there’s many times where if you don’t save your work, you’ll run into issues when you attempt to:
- Run your code from the terminal: If you haven’t saved your work, the terminal will run the last saved version of your code, not the current version you see on your screen.
- Make commits to Git: If you haven’t saved your work, you’ll be committing the last saved version of your code, not the current version you see on your screen that you intended to commit.
- Run the Code Style tool: If you haven’t saved your work, the Code Style tool will might not recognise changes you’ve made to your code, so it will just run on the previous commit you pushed to GitHub,
- and many more…
Auto Save is a feature that automatically saves your files after a certain period of time or after a certain action. This feature is disabled by default in VS Code, but you can enable it by one of two ways:
Option 1: Add the following setting to your .vscode/settings.json
file:
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 1000 // in milliseconds
Option 2: Go to the settings UI:
Go into settings by pressing Ctrl + ,
and search for files.autoSave
and set it to afterDelay
. You can also set the delay time in milliseconds by searching for files.autoSaveDelay
and setting it to your desired value (e.g. 1000 milliseconds).
For more information on Auto Save, check out the official VS Code documentation.
More VS Code guides
Check out the other VS Code guide pages: