Is there a way to sort of exclude or "outsource" some setting from settings.json in VSCode?
I have set up my settings.json to be auto-synced with my Nextcloud, so I have the same settings on multiple devices. Now, I switch light and dark themes on my systems multiple times during the day, which also changes the theme setting in settings.json every time. So a new version will get uploaded to Nextcloud everytime.
Sometimes this results in a conflicted file, because I switched themes back and forth too fast, or whatever. So I was thinking of whether I can say something like
"workbench.colorTheme": {"source": "/home/me/.local/share/vscode/workbench.colorTheme.json"}which will then be excluded from Nextcloud sync.
2 Answers
The answer on the postCan I exclude certain settings with VS Code built-in settings sync feature?says that it's possible to exclude some settings from sync, like this:
{ "settingsSync.ignoredSettings": [ "editor.fontSize" ]
}If this does not help, another trick might be to use the fact that
by default Nextcloud does not sync hidden files
(see link),
so making settings.json as hidden might do it.
After reviewing harrymc's answer, I found that there are multiple extensions that sort of do what I want.
While "Settings Sync" and "Syncing" only provide to syncronize with some commercial public online service, the one called Sync Settings lets me freely choose between local and remote git, rsync, webdav and local file system. The latter suits my Nextcloud setup.