Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per-platform / per-hostname inline settings #640

Closed
shanalikhan opened this issue Sep 13, 2018 · 19 comments
Closed

Per-platform / per-hostname inline settings #640

shanalikhan opened this issue Sep 13, 2018 · 19 comments

Comments

@shanalikhan
Copy link
Owner

Proposed by @jacobdufault and @borekb on #555 (#555 (comment) and
#555 (comment) )

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.

@IssueHuntBot
Copy link

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

@vdiaz1130
Copy link

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?

@IssueHuntBot
Copy link

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

@shanalikhan
Copy link
Owner Author

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

@shanalikhan
Copy link
Owner Author

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

@mnbf9rca
Copy link

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...

@mnbf9rca
Copy link

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

@shanalikhan shanalikhan modified the milestones: v3.2, Backlog Sep 27, 2018
@IssueHuntBot
Copy link

@ioprotium has started working. Visit this issue on Issuehunt

@IssueHuntBot
Copy link

@ioprotium has submitted output. Visit this issue on Issuehunt

@protiumx
Copy link
Contributor

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

@IssueHuntBot
Copy link

@shanalikhan has rewarded. Visit this issue on Issuehunt

@shanalikhan
Copy link
Owner Author

@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.

@shanalikhan shanalikhan modified the milestones: Backlog, v3.2 Oct 13, 2018
@shanalikhan
Copy link
Owner Author

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

@mnbf9rca
Copy link

Is there a spec defining use?

@shanalikhan
Copy link
Owner Author

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

I will write the articles soon.

@mnbf9rca
Copy link

mnbf9rca commented Oct 17, 2018 via email

@borekb
Copy link

borekb commented Oct 18, 2018

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.

@connorshea
Copy link

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

@shanalikhan
Copy link
Owner Author

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

#308

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants