Skip to content

Add support for additional global config files (in addition to settings.json) #17634

Closed

Description

It would be very helpful for somebody attempting to sync config files between multiple machines if VSCode supported some system for having multiple config files included at a time.

Benefits:

Imagine a config folder structure like this on a developer's mac:

- settings.json -> ~/Drive/dotfiles/settings.json
- settings.local.json -> ~/Drive/dotfiles/settings.my-mac.json

And then like this on a developer's linux desktop:

- settings.json -> ~/Drive/dotfiles/settings.json
- settings.local.json -> ~/Drive/dotfiles/settings.my-arch.json

Using symlinks, then, a developer would be able to have specialized configuration files for each computer, while keeping the vast majority of options synced between both.

Implementation:

I can think of two simple ways to implement this with as little friction as possible.

  1. An editor.includeConfig option in the main settings.json
    This might be a JSON array, with support for various different config files. It could also just be a single field.
    Whether or not the option should be recursive is up to the VSCode team.
  2. VSCode searches for all config files in the directory matching settings[.foo].json and includes those.

Conflicts:

If going with option (1) above, conflicting config entries should take precedence the later they appear in the includeConfig array.

If going with option (2), the main settings.json file should take precendence.

Activity

  1. changed the title [-]Add support for additional global config files (similar to settings.json)[/-] [+]Add support for additional global config files (in addition to settings.json)[/+] on Dec 21, 2016
  2. added
    feature-request
    config
    on Dec 21, 2016
  3. egamma commented on Dec 21, 2016

    @egamma
    Member
  4. Tyriar commented on Dec 21, 2016

    @Tyriar
    Contributor

    Gui Andrade (@archshift) I'm curious what settings differ across your Mac and Linux configs? Another potential solution is to have .linux/.osx/.windows settings available for all settings instead of just a select few?

    /cc Sandeep Somavarapu (@sandy081) João Moreno (@joaomoreno)

  5. archshift commented on Dec 21, 2016

    @archshift
    Author

    Daniel Imms (@Tyriar) it's not so much about OSs and more about computers.

    Let's say I have a laptop and a desktop (both Windows, for instance), and the two computers have different screen sizes/resolutions. I might want to set editor.fontSize to 12 on my desktop and 10 on my laptop.

    This also applies to extensions. If I'm using the Rust extension, which has options like rust.racerPath and rust.cargoPath, the paths might be different from computer to computer.

  6. borekb commented on Feb 7, 2017

    @borekb

    settings.local.json is something we would use as well.

    In our case, this would be on the workspace level: we'd commit .vscode/settings.json to our team Git repo and share things like files.exclude but the developers would be able to define / override the settings in their .local files.


    BTW this is a common issue with IDEs. We commonly commit something like .idea-tpl instead of .idea to Git, then have some sort of a build script that copies this to the real location. It would be so nice if Code understood this common struggle and provided a way to deal with it elegantly.

  7. mikelward commented on Jul 22, 2017

    @mikelward

    Daniel Imms (@Tyriar) The requested feature is also useful for maintaining separate override configs for home vs. work, or for each client. For example, different default tab size and linter settings. Hard-coding it to only split based on platform would be too restrictive.

  8. philipmat commented on Aug 17, 2017

    @philipmat

    Mikel Ward (@mikelward) Sounds as if workspace settings might be of better use to you.

  9. larsch commented on Oct 5, 2017

    @larsch

    This suggestion would be useful to us even in the workspace settings alone. Some settings could be shared (commited) and some could be personal or system specific. I have workspaces on multiple platforms and sometimes need to tweak local settings per workspace, e.g. terminal settings, EOL settings, run code settings, file exclude settings, git settings, etc.

  10. stillward commented on Dec 7, 2017

    @stillward

    Hope this feature will be imported, including launch.json and other setting files.
    Separate TEAM shared workspace setting and PERSONAL specific setting.
    Just like coding with Class Inheritance :)
    Thanks

  11. mikelward commented on Dec 11, 2017

    @mikelward

    Philip Mateescu (@philipmat) Here's my breakdown:
    global: shortcuts, colors, fontSize, etc.
    company/machine: tabSize, rulers, formatTool, pylintPath, etc.
    project/workspace: maybe some overrides could be useful, but for me there aren't any

    Doing it using workspace settings would mean I'd need to copy my settings for every one of hundreds of projects. And I wouldn't be allowed to check in vscode-specific configs into my projects, so I'd have to re-create them every time I made a new checkout.

    Sure I could script it, but supporting a "local" include file makes way more sense IMHO.

  12. ineol commented on Jan 26, 2019

    @ineol

    Hi,

    are there any updates on this?

    thanks!

  13. 31 remaining items

  14. added
    *duplicate
    on Oct 13, 2021
  15. vscode-triage-bot commented on Oct 13, 2021

    @vscode-triage-bot

    Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

    Happy Coding!

  16. pavlodenysov-vizio commented on Oct 13, 2021

    @pavlodenysov-vizio

    Sandeep Somavarapu (@sandy081) #5595 is not exactly the same. I may have 2 Linux machines that I want to use different settings on.

  17. sandy081 commented on Oct 13, 2021

    @sandy081
    Member

    Right, got it.

  18. added
    feature-request
    and removed
    *duplicate
    on Oct 13, 2021
  19. ctf0 commented on Mar 25, 2022

    @ctf0

    +1 to this as well, except for a slightly different use case,

    when using something like https://github.com/antfu/vscode-file-nesting-config the settings file become very big to parse and it slows down the whole thing even u try to just open the settings editor.

    another example would be something like https://github.com/shanalikhan/code-settings-sync in case u have settings for multiple machines/hosts u use ex.

    • // @sync host=home os=windows
    • // @sync host=home os=mac
    • etc..

    there are amillion other extension that can quickly bloat the settings file & separating the config between multiple files will surely make things easier to organise & quicker for the editor.

    btw this is already possible with theme files ex."include": "./syntax.json"

  20. SebGt commented on Oct 7, 2022

    @SebGt

    Hi,
    Please, any updates or ETA?
    Because all other issues opened related to the same topic are closed because they duplicate this one but I don't see any progress on this one.
    Thanks

  21. sandy081 commented on Dec 14, 2022

    @sandy081
    Member

    It seems this is a duplicate of following features we already have or working on

    Hence closing this as duplicate of all these features.

  22. added
    *duplicate
    on Dec 14, 2022
  23. locked and limited conversation to collaborators on Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*duplicateconfigfeature-request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions