Exporting Settings and Extensions in Visual Studio Code

avatar
Borislav Hadzhiev

Last updated: Apr 6, 2024
6 min

banner

# Table of Contents

  1. Exporting Settings and Extensions in Visual Studio Code
  2. Manually syncing your settings
  3. Configuring which settings are stored
  4. Exporting your VS Code settings and extensions
  5. Importing a Profile in VS Code
  6. Viewing your profile's contents
  7. Where profiles are stored
  8. Manually copying specific settings to another computer

# The 2 main ways to export settings and extensions in VS Code

There are 2 main ways to export settings and extensions in VS Code.

You can:

  • Use the built-in Settings sync functionality (recommended).
  • Manually copy the settings and extensions and paste them into the corresponding folders on your other computer.

Using the built-in Settings sync functionality is quite intuitive, so this is the recommended approach.

Click on your preferred approach to navigate to the subheading:

# Exporting Settings and Extensions in Visual Studio Code

The best way to export settings and extensions in Visual Studio Code is to use the built-in Settings Sync functionality.

To turn on settings sync:

  1. Click on the gear icon at the bottom left part of the Activity Bar.

turn on settings sync

  1. Click on the Turn on Settings Sync... option.

  2. You will be prompted to select which settings you want to sync.

  3. Click on the Sign in & Turn on button at the top right.

sign in to turn on

  1. Sign in with GitHub or Microsoft.

sign in with github or microsoft

  1. A browser tab will open so that you can sign in with your Microsoft or GitHub account.

If you pick Microsoft, you can either use your Outlook account, an Azure account or link a GitHub account to an existing Microsoft account.

  1. Once you're signed in, Settings Sync is activated and syncs your settings in the background.

If you follow the same steps on a different machine:

  1. Enable Settings sync.
  2. Log in with the same account.

Your VS Code settings will automatically get imported on the other machine.

# Manually syncing your settings

Settings get automatically synced over time, e.g. every 30 minutes or every hour. However, you can also manually sync your settings if you've made important changes.

If you want to manually sync your settings:

  1. Press:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type settings sync now and click on Settings Sync: Sync Now.

settings sync now

To view your synced settings:

  1. Press:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
  1. Type settings sync show and click on Settings Sync: Show Synced data.

show synced data

  1. Click on the Settings Sync icon in the left Activity Bar.

click on settings sync icon

You can also open the menu by:

  1. Pressing:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
  1. Typing show settings sync and clicking on View: Show Settings Sync.

view show settings sync

The Sync activity is shown in the Explorer window.

view sync activity

The sync activity tab has directories where your settings, keyboard shortcuts, snippets, UI state, extensions and profiles are stored.

Each directory contains a JSON file with the corresponding settings.

If you want to restore your settings from a specific directory, click on the arrow next to the directory.

restore settings from directory

# Configuring which settings are stored

If you need to configure which settings are stored:

  1. Press:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type settings sync configure and click on Settings Sync: Configure.

settings sync configure

  1. You can select which settings you want to store. For example, you can only sync your extensions and UI state by ticking only selected boxes.

select which settings are stored

Once you're done click on the OK button.

# Exporting your VS Code settings and extensions

If you need to export your VS Code settings and extensions into a file:

  1. Press:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type export profile and click on Profiles: Export Profile....

export profile

  1. Tick the options you want to export in the sidebar and click on the Export button.

select what to export

  1. You will then get prompted to name your profile.

  2. Type a name for your profile and press Enter.

type profile name

  1. You can export your profile into a GitHub gist or a local file.

export github gist or local file

  1. I'll use a local file for the tutorial.

Once you export your profile into a local file (or a GitHub gist), you can use the local file (or the GitHub gist) to restore your settings on a different computer.

# Importing a Profile in VS Code

If you need to import a profile on a different computer:

  1. Press:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type import profile and click on Profiles: Import Profile....

import profile

  1. You will be prompted for a URL or a local file.

import from url or profile file

If you exported your profile as a GitHub gist, paste the URL and press Enter.

Otherwise, navigate to the directory that contains your local file and select it.

Once you select the profile file or enter the GitHub gist URL, you will be able to select the settings you want to import.

click import profile

If you don't want to import some of the settings, uncheck the checkboxes before clicking on the Import Profile button.

Once you click on the Import Profile button, the profile will be imported successfully and your VS Code instance will be in sync.

# Viewing your profile's contents

If you need to view your profile's contents:

  1. Press:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type profiles show and click on Profiles: Show Contents....

profiles show contents

# Where profiles are stored

The location where profiles are stored depends on your operating system.

On Windows, profiles are stored under:

  • %APPDATA%\Code\User\profiles

The path resolves to C:\Users\<username>\AppData\Roaming\Code\User\profiles.

Make sure to replace the <username> placeholder with your actual username.

On macOS, profiles are stored under:

  • $HOME/Library/Application\ Support/Code/User/profiles

On Linux, profiles are stored under:

  • $HOME/.config/Code/User/profiles

# Manually copying specific settings to another computer

If you decide to manually copy specific settings, here are the paths, depending on your operating system:

On Windows, the path is:

  • %APPDATA%\Code\User

The path resolves to C:\Users\<username>\AppData\Roaming\Code\User.

Make sure to replace the <username> placeholder with your actual username.

On macOS, the path is:

  • ~/Library/Application\ Support/Code/User/

On Linux, the path is:

  • ~/.config/Code/User

The folder contains the settings.json and keybindings.json files which you can copy and paste into the same folder on your other machine.

The extensions are located under:

On Windows, the path is:

  • %USERPROFILE%\.vscode\extensions

The path resolves to C:\Users\<username>\.vscode\extensions.

Make sure to replace the <username> placeholder with your actual username.

On macOS and Linux, the path is:

  • ~/.vscode/extensions

You can copy the extensions and paste them into the same folder on your other machine.

I've also written an article on how to reset VS Code to the default settings.

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.