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

Allow to scope settings by platform #5595

Open
arnaud-lecat opened this issue Apr 21, 2016 · 159 comments
Open

Allow to scope settings by platform #5595

arnaud-lecat opened this issue Apr 21, 2016 · 159 comments
Assignees
Labels
config VS Code configuration, set up issues feature-request Request for new features or functionality
Milestone

Comments

@arnaud-lecat
Copy link

Hi

I develop on 3 different platform. When synchronizing settings, snippets and so on, i often must change path, adjust font-size, etc...

So, it could be great if we had a per platform settings set (Windows, Mac, Unix)

@dbaeumer dbaeumer added this to the Backlog milestone Apr 21, 2016
@dbaeumer
Copy link
Member

@bpasero, @aeschli FYI.

@dbaeumer dbaeumer added the feature-request Request for new features or functionality label Apr 21, 2016
@bpasero bpasero changed the title Per platform settings Allow to scope settings by platform Apr 21, 2016
@bpasero bpasero self-assigned this Apr 21, 2016
@bpasero
Copy link
Member

bpasero commented Jul 15, 2016

#8962

@bpasero bpasero closed this as completed Jul 15, 2016
@bpasero bpasero added the *duplicate Issue identified as a duplicate of another issue(s) label Jul 15, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
@Tyriar Tyriar added config VS Code configuration, set up issues and removed *duplicate Issue identified as a duplicate of another issue(s) labels Aug 15, 2018
@microsoft microsoft unlocked this conversation Aug 15, 2018
@Tyriar Tyriar reopened this Aug 15, 2018
@Tyriar
Copy link
Member

Tyriar commented Aug 15, 2018

#8962 is about keybindings, not settings

@sandy081
Copy link
Member

Planning for October to Kickoff

@sandy081 sandy081 modified the milestones: October 2018, Backlog Oct 29, 2018
@tn-072
Copy link

tn-072 commented Dec 26, 2023

What about this:

{
    // ...
    "[sys:win]": {
            "python.defaultInterpreterPath": "<my python path on windows>",
    },
    "[sys:linux]": {
            "python.defaultInterpreterPath": "<my python path on linux>",
    },
    "[sys:osx]": {
            "python.defaultInterpreterPath": "<my python path on Mac>"
    },
    // ...
}

which uses similar syntax like language-specific settings:

{
    // ...
    "[cpp]": {
        "editor.formatOnSave": true,
        "editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd",
    },
    // ...
}

@sdholden
Copy link

Some sort of solution is long overdue...any progress?

@buzcarter
Copy link

I'll second @tn-072 's suggestion.

{
    "editor.fontSize": 14,
    "python.pythonPath": "/usr/local/bin/python3",
    "[windows]": {
        "editor.fontSize": 16,
        "python.pythonPath": "C:\\Python39\\python.exe"
    },
    "[mac]": {
        "editor.fontSize": 18,
        "python.pythonPath": "/usr/local/bin/python3"
    },
    // ... the shared bits
}

@sanmai-NL
Copy link

Instead of scoping by 'platform' I suggest to scope by user-defined tag(s), to support use cases where the same OS is used for different purposes (e.g. work Linux, personal Linux) beyond what profiles can offer.

@heartacker
Copy link
Contributor

Instead of scoping by 'platform' I suggest to scope by user-defined tag(s), to support use cases where the same OS is used for different purposes (e.g. work Linux, personal Linux) beyond what profiles can offer.

What you say is profile

@sanmai-NL
Copy link

sanmai-NL commented Jan 9, 2024

Then all combinations of language, macOS/Linux/Windows, work/personal would need to be separate profiles.

@starball5
Copy link

starball5 commented Jan 9, 2024

I ctrl+f-ed for "profile" and several times when the profiles approach came up in past discussion, it was dismissed because at the time, it required creating a standalone copy of settings, and there was no way to inherit from the default. For those people, see #156144, which as released in July 2023. I'm not saying this is the solution. I'm just saying it may be more attractive as a workaround than it had been previously.

@jd-solanki
Copy link

Why it's still in backlog?

@pfeerick
Copy link

pfeerick commented Jun 6, 2024

I'd love to see this feature for the some of the above reasons such as OS and path specific differences, but also because I set the new option

"terminal.integrated.middleClickBehavior": "paste"

which works great on Windows, but on Linux (which picks up the setting because I have Settings Sync enabled), it makes it paste the clipboard content + selection rather than just the selection, so I've had to set it back to default now. 🤣

@starball5
Copy link

@pfeerick oh interesting. Are you aware of "editor.selectionClipboard": false,? See also https://stackoverflow.com/q/36723333/11107541

@Poikilos
Copy link

Then all combinations of language, macOS/Linux/Windows, work/personal would need to be separate profiles.

If you have a work and personal account on your linux/macOS/Windows machine, that is 6 accounts. If you need it that fine-grained, you could already just put the setting in your user profile. It isn't directly related to this. There is no way to detect if you are work or personal...that is a user-level abstract distinction.

@pfeerick
Copy link

@pfeerick oh interesting. Are you aware of "editor.selectionClipboard": false,? See also

No I wasn't... thanks for that!. It fixes the "double" paste (one from selection, one from clipboard), but does mean you must use the clipboard if using middleClickBehavior": "paste", so still not ideal. Spotted terminal.integrated.copyOnSelection as well though which I didn't know about... that would work if just working with terminal, and not wanting to mix editor and terminal.

@alexchexes
Copy link

alexchexes commented Jun 18, 2024

In the meantime (the discussion has lasted 8 years and doesn't seem to be progressing), how do you all set a comfortable font when switching machines? On my MacBook, I'm good with a 12px font, but on my Windows machine, I need at least 14px. What do you do in such cases (when Settings Sync is On)?

@sanmai-NL
Copy link

You can use settings profiles nowadays. Maybe you can template them?

@alexchexes
Copy link

@sanmai-NL
Could you please provide a bit more detail about your suggestion? I checked out the VSCode documentation, but it seems that templates refer to a predefined set of configurations used for different programming languages or common environments. Not sure how I could use that to keep all my settings in sync while having different font sizes on Mac and Windows...

@sanmai-NL
Copy link

I mean templating VS Code settings with an external tool, and putting the per-OS outputs in a dotfiles repository.

@hermes85pl
Copy link

What do you do in such cases (when Settings Sync is On)?

@alexchexes, one solution would be to treat such settings as device-specific and put them under settingsSync.ignoredSettings.

@iwangbowen
Copy link

Any updates

@rnetonet
Copy link

Please, this will be so useful!

@JamesSwivel
Copy link

I guess platform-specific settings are useful. For example, I want to have one settings.json that can address Windows and Linux Python virtualenv requirements. For example below

{
  "windows": {
     "python.defaultInterpreterPath": ".\\winEnv\\Scripts\\python.exe",
  },
  "linux": {  
      "python.defaultInterpreterPath": "${env:HOME}/.pyenv/versions/3.11.8/envs/virtualenvX/bin/python3",

}

Any suggestion to address this common Python requirement?

@Hirak232
Copy link

Hirak232 commented Sep 3, 2024

Advertisement-JW-253-posts-260123.pdf

@eeplus-oka
Copy link

When standardizing environment settings across project teams, I think the easiest way is to distribute the settings.json along with the source code. How about splitting the files in a similar way to Visual Studio's appsettings.json (e.g., appsettings.development.json and appsettings.production.json)?

  • settings.json
  • settings.[platform].json
  • settings.windows.json
  • settings.macos.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config VS Code configuration, set up issues feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests