This repository helps you back up and restore VSCode settings, keybindings, snippets, and installed extensions across macOS, Linux, and Windows.
Run the following script to back up your current VSCode configuration:
./backup.shThis backs up:
settings.jsonkeybindings.json- All user snippets
- List of installed extensions β
vscode-extensions.txt
Backed up files are stored in the User/ folder.
To restore your VSCode configuration on a new system:
./restore.shMake sure the code CLI is available on your path.
To enable the
codecommand from VSCode:
Open VSCode β PressCtrl+Shift+Pβ Run:
Shell Command: Install 'code' command in PATH
| OS | Supported? | Notes |
|---|---|---|
| macOS | β | $HOME/Library/Application Support/Code/User |
| Linux | β | $HOME/.config/Code/User |
| Windows | β | Uses $APPDATA/Code/User (compatible with Git Bash or WSL) |
| File/Folder | Description |
|---|---|
User/settings.json |
Global VSCode editor settings |
User/keybindings.json |
Custom keybindings |
User/snippets/ |
All user-defined code snippets |
vscode-extensions.txt |
List of all installed extensions |
To track and sync your config across machines, set up a Git repo:
git init
git add .
git commit -m "Initial VSCode backup"
gh repo create vscode-backup --private --source=. --remote=origin --pushRequires the GitHub CLI
- Consider automating backups with a cron job (Linux/macOS) or Task Scheduler (Windows).
- Always ensure VSCode is closed before restoring settings to avoid overwrites.
- Run backup regularly, especially after major customization or extension changes.
If you're backing up sensitive snippets or settings, consider encrypting the backup with gpg:
tar czf - User/ vscode-extensions.txt | gpg -c > vscode-backup.tar.gz.gpgThen commit the .gpg file instead of the raw data.