Skip to content

toiroakr/vsc-sync

Repository files navigation

vsc-sync

npm version License: MIT

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.

Installation

npm install -D vsc-sync

Usage

Initialization

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.

Synchronization

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.

Git Hook Setup

Husky

npm install husky --save-dev
npx husky init

.husky/post-checkout

npx vsc-sync sync

Lefthook

npm install lefthook --save-dev
npx lefthook install

lefthook.yml

post-checkout:
  jobs:
    name: sync vscode settings
    run: npx vsc-sync sync

About

A CLI tool to share vscode settings.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published