vsc-sync is a CLI tool designed to share .vscode/settings.json
within a development team.
It allows teams to establish and maintain a set of common settings, while also providing the flexibility for individual team members to override these settings according to their preferences.
npm install -D vsc-sync
vsc-sync init
- Adds the following to
.gitignore
:.vscode/settings.json .vscode/settings-local.jsonc
- If
.vscode/settings.json
exists, copies it to.vscode/settings-project.jsonc
. - Creates an empty
.vscode/settings-local.jsonc
if it doesn't exist.
vsc-sync sync
- Merges
.vscode/settings-project.jsonc
and.vscode/settings-local.jsonc
to create.vscode/settings.json
. - It's recommended to run this command with a Git post-checkout hook.
npm install husky --save-dev
npx husky init
.husky/post-checkout
npx vsc-sync sync
npm install lefthook --save-dev
npx lefthook install
lefthook.yml
post-checkout:
jobs:
name: sync vscode settings
run: npx vsc-sync sync