shanalikhan/code-settings-sync

Per-platform / per-hostname inline settings #640

shanalikhan posted onGitHub

Proposed by @jacobdufault and @borekb on #555 (https://github.com/shanalikhan/code-settings-sync/issues/555#issue-324795463 and https://github.com/shanalikhan/code-settings-sync/issues/555#issuecomment-418523169 )

replaceCodeSettings may mostly work, but I think the following approach may be more flexible/have merit.

There could be just @sync affecting just the next line which would be by far the most common use case for me. For example:

{
    // @sync os=windows host=PC
    "window.menuBarVisibility": "toggle",

    // @sync os=windows host=Laptop
    "window.menuBarVisibility": "none",

    // this one is applied on all my machines
    "window.titleBarStyle": "custom",

    // @sync host=PC
    "editor.fontSize": 12

    // @sync host=Laptop
    //"editor.fontSize": 16
}

I would also appreciate an "ignore" pragma that would make sure certain setting is simply not touched (both during upload and download):

{
    // @sync-ignore
    "window.zoomLevel": 2
}

What I mean by "not touched" is:

  • When I download settings.json that contains e.g. "window.zoomLevel": 1, it doesn't overwrite my value of 2.
  • When I upload (sync > upload), the value of "window.zoomLevel" in the remote Gist is not overwritten with my local value.

There should be host defined in the Sync Global Settings. While downloading it should download all the settings but make sure to comment the specified code settings. Like for example :

Upon downloading, the machine has windows OS and host as pc it should only uncomment those settings and generic ones.


Fund this Issue

Rewarded pull request

Recent activities

ioprotium was rewarded by shanalikhan for shanalikhan/code-settings-sync# 640
over 6 years ago