Code-settings-sync: Per-platform / per-hostname inline settings

Created on 13 Sep 2018  路  19Comments  路  Source: shanalikhan/code-settings-sync

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.

bounty feature-request 馃挕 fixed

Most helpful comment

Great work on this, it really takes Sync Settings to the next level. Thank you! I just found an issue in the ignore behavior for which I've created a separate issue: #686.

All 19 comments

@boostio funded this issue with $80. Visit this issue on Issuehunt

I arrived here because I use VS code on a Windows and OS X machines. In its local settings I have:

// On OS X
"git.path": "/usr/bin/git",

// On Windows
"git.path": "C:\Program Files\git\bin\git.exe"
"terminal.integrated.shell.windows": "C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe",

I'd like to keep "git.path" as is on both machines while not copying (ignoring) "terminal.integrated.shell.windows"... In essence ignoring both settings.

ignoreSettings: ["git.path", "terminal.integrated.shell.windows"]

Am I correct in understanding that something like this is currently not possible?

@loadbalance-sudachi-kun funded this issue with $256. Visit this issue on Issuehunt

Am I correct in understanding that something like this is currently not possible?

Read the details at : https://medium.com/@itsShanKhan/visual-studio-code-settings-sync-configurations-ed8dd6fd9753

This issue is funded, anyone is welcome to work and earn the money :smile:

I also have this issue. For me, the ideal way to do this would be to have different platforms and allow me to set specific keys for specific plugins which are either:

  • synced, or
  • set them to be ignored

e.g. i dont need to set python path on every machine, it's usually picked up automatically ok and if it's not, it's a one time change, but doesnt need to be synced between different machines.

replaceCodeSettings is ok but not ideal as it doesnt allow you to "ignore" a setting. that might be a quick fix...

perhaps another solution might be to have a config option "ignorekeys" which accepts a list of keys to ignore on sync.

@ioprotium has started working. Visit this issue on Issuehunt

@ioprotium has submitted output. Visit this issue on Issuehunt

@shanalikhan do you know if I must submit something to issuehunt to get the bounty? First time using that platform. Thanks in advance!

@shanalikhan has rewarded. Visit this issue on Issuehunt

@ioprotium i have just rewarded you the price for bounty.
Its my first time too in issuehunt actually 馃槃

I think you need PayPal to transfer the money.

v3.2 is released with this feature. Let me know if there is any problem

Is there a spec defining use?

Check the wiki at
https://github.com/shanalikhan/code-settings-sync/wiki/Sync-Pragmas

I will write the articles soon.

馃憤

Great work on this, it really takes Sync Settings to the next level. Thank you! I just found an issue in the ignore behavior for which I've created a separate issue: #686.

Would this be possible for extensions as well, or no?

For host specific extensions, i think its better to create new GIST.

https://github.com/shanalikhan/code-settings-sync/issues/308

Was this page helpful?
0 / 5 - 0 ratings