/global-config

Allows copying of shared config settings in vscode

Primary LanguageJavaScript

Global Config

I got fed up constantly having to copy shared configuration files (tasks.json, settings.json, launch.json and cpp_properties.json) into every folder in my project (there are hundreds) so this extension simply adds a command Copy Global Config to copy them into the local .vscode folder from a common location.

In-built support for shared config is apparently on the radar (for standard vscode and for the cpp extension), but it seems to be taking a while, so this might be useful until it arrives.

To use:

  1. Place your default files (e.g. tasks.json, settings.json, launch.json, etc.) in a folder somewhere. By default, the extension will look in ~/.vscode/.
  2. If you choose a different folder, open your settings and point global-config.folder to that folder.
  3. Open a new VSCode window and run the Global Config: Copy Global Config command, to copy (or link) the files into your local folder (.vscode).

Note: Existing files will not be replaced.

When used in a multi-root workspace folder, the global files are copied into each workspace .vscode folder.

You can also put multiple sets of default files into subfolders of your configured source folder. When running the copy command, it will prompt you to choose one of the subfolders first. Note, using subfolders will ignore any files in the configured source folder.

Installing

You can install the latest version of the extension via the Visual Studio Marketplace here.

Alternatively, open Visual Studio code, press Ctrl+P or Cmd+P and type:

> ext install global-config

Source Code

The source code is available on GitHub here.

Configuration

global-config.folder

Use this to set which folder should contain your shared config files. The default is ~/.vscode.

global-config.links

This is an array of files which should be symlinked instead of copied. This is useful for files which may change in the future, e.g. settings.json

Note: For symlinks to work correctly under Windows 10 (and possible other Windows versions) you will need to run Code in Developer Mode.

Output

When the Copy Global Config is run, an output channel is created in the Output View. If the extension doesn't seem to be doing what you expect, please check the contents of the output channel.