User Agents

Web browsers and everyday web tech, explained

Reinstall VS Code Without Losing Settings and Extensions

· 5 min read · Settings and Privacy

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Reinstalling Visual Studio Code (VS Code) without losing your configuration is possible because the application separates the executable program from your user data. Your extensions, themes, keyboard shortcuts, and custom settings are stored in specific folders on your hard drive that are not deleted during a standard uninstallation process. By following the correct removal and installation sequence, you can refresh the software to fix glitches or update the core installation while keeping your entire development environment intact.

What You'll Need

  • An active internet connection to download the latest installer.
  • Administrator privileges on your operating system to uninstall and install software.
  • (Optional) A backup of your settings.json file if you are performing a high-risk system migration.

Step-by-Step

  1. Enable Settings Sync (Recommended): Before uninstalling, the safest way to ensure no data is lost is to use the built-in Settings Sync. Click the Gear icon in the bottom left corner and select "Turn on Settings Sync". Sign in with your GitHub or Microsoft account. This uploads your settings, keybindings, snippets, extensions, and UI state to the cloud.
  2. Locate Your User Data Folders: To understand why your data survives the uninstall, know where it lives.
    • Windows: Settings are in %APPDATA%\Code and extensions are in %USERPROFILE%\.vscode\extensions.
    • macOS: Settings are in ~/Library/Application Support/Code and extensions are in ~/.vscode/extensions.
    • Linux: Settings are in ~/.config/Code and extensions are in ~/.vscode/extensions.
  3. Uninstall Visual Studio Code:
    • Windows: Go to Settings > Apps > Installed Apps, find Visual Studio Code, and click "Uninstall".
    • macOS: Open the Applications folder and drag Visual Studio Code to the Trash.
    • Linux: Use your package manager (e.g., sudo apt remove code) or delete the installation directory.
  4. Avoid "Deep Cleaning" Tools: During or after uninstallation, do not use third-party "uninstaller" software that claims to "remove leftover files" or "clean the registry." These tools are designed to find and delete the very folders mentioned in Step 2, which would result in the loss of your extensions and settings.
  5. Download the Latest Version: Visit the official Visual Studio Code website and download the installer corresponding to your operating system.
  6. Run the Installer: Execute the installation file. Follow the prompts to complete the setup. If you are on Windows, it is recommended to check the boxes for "Add "Open with Code" to Windows Explorer context menu" for convenience.
  7. Launch and Verify: Open VS Code. Because the new installation looks for the existing user data folders in the default system paths, it should automatically detect your previous settings and extensions. You will see your theme, custom font, and installed plugins active immediately.
  8. Sync Back (If Necessary): If for some reason the local folders were corrupted or cleared, click the Gear icon and "Turn on Settings Sync" again. Sign in to your account, and VS Code will download your configuration from the cloud.

Common Mistakes

  • Deleting the .vscode Folder: Some users manually delete the .vscode folder in their user directory thinking it is "junk" left over from the uninstall. This folder contains all your installed extensions; deleting it forces you to reinstall every plugin manually.
  • Using "Clean Uninstall" Scripts: Some community-made scripts for "fresh installs" specifically target the AppData or Application Support folders. Avoid these if you intend to keep your settings.
  • Confusion Between User and System Installers: On Windows, there is a "User Installer" and a "System Installer". If you previously used the User Installer and now use the System Installer, the paths may differ slightly. Stick to the version you previously used to ensure the software looks in the correct directory for your data.

Tips

  • Export Extensions to a List: If you are nervous about data loss, run the command code --list-extensions > extensions.txt in your terminal. This creates a text file of every extension you have, which can be used to reinstall them via script if needed.
  • Use a Portable Version: If you frequently move between machines or reinstall OSs, consider the ".zip" or ".tar.gz" version of VS Code. By creating a folder named data inside the application folder, VS Code enters "Portable Mode," storing all settings and extensions in that single folder.
  • Regularly Back Up settings.json: Your settings.json is the heart of your configuration. Periodically copy this file to a cloud drive or a private Git repository.

Troubleshooting

What if my extensions are missing after reinstalling?
Check if you installed a different version of VS Code (e.g., switching from the User Installer to the System Installer on Windows). Ensure the .vscode/extensions folder still exists in your user home directory. If it is gone, use Settings Sync to recover them.

My settings are back, but my themes are gone.
Themes are treated as extensions. If your settings (like workbench.colorTheme) are present but the theme isn't applying, the extension folder was likely deleted. Reinstall the theme from the Marketplace or via Settings Sync.

VS Code is acting exactly as it did before the reinstall.
If you were reinstalling to fix a bug, a standard reinstall often doesn't work because the bug may reside in your user settings or a corrupted extension rather than the program files. In this case, try disabling all extensions to see if the problem persists.

Frequently Asked Questions

Does uninstalling VS Code delete my code files?

No. VS Code is an editor, not a file storage system. Your project folders and source code files are stored wherever you saved them on your hard drive and are completely untouched by the uninstallation process.

Do I need to manually move folders during reinstallation?

No. As long as you do not manually delete the AppData (Windows) or Application Support (macOS) folders, the new installation will automatically find and use your existing data.

Will my keyboard shortcuts be preserved?

Yes. Keyboard shortcuts are stored in the keybindings.json file within the user data folder, which is not removed during a standard uninstall.

Can I move my settings to a different computer?

The easiest way is using Settings Sync with a GitHub or Microsoft account. Alternatively, you can manually copy the Code and .vscode/extensions folders to the corresponding paths on the new machine.

What is the difference between the User and System installer on Windows?

The User Installer installs VS Code in the local user folder and doesn't require admin rights. The System Installer installs it in Program Files and is available to all users on the PC. Both use the same user data folders for settings.