Using VSCode in few platforms & devices. Sometimes, I liked larger font size in Desktop but smaller in Laptops. Windows & OSX, we may have different settings too. It would be useful if we can ignore to sync some settings.
Apart from ignoring only the screen size, there is another scenario where users working in proxies needs to ignore the proxy settings which allow them to to sync the settings to non proxy environments.
There is a need to ignore some settings while sync, so i have to reopen this issue
I will work on it later on.
One Option to Add this to add new JSON File in User Folder allowing user to define keys for each files he wants to ignore the settings.
For example
{
"settings.json":["screen-Size", "http.proxy"]
}
Second Option Would be to add this support in settings.json file, rather than fetching from new file
It would be great if we could exclude entire *.json-files. For example I use the extension alefragnani/vscode-project-manager and I sync my work machines settings with my private one. I'm happy to have all my settings in both environments but I don't need the projects.json which is created by the extension. I think there are other cases too.
@macroloft can you provide the path of all Json files that extension is creating.
@shanalikhan on my Mac it's ~/Library/Application Support/Code/User/ and the projects.json seems to be the only file the extension creates.
It would be great if we could exclude entire *.json-files. For example I use the extension alefragnani/vscode-project-manager and I sync my work machines settings with my private one.
Same situation here. In fact, one overwrites the other causing all the project settings gone.
Thanks for Explaining well.
I understand i will solve this in next version.
Meanwhile you can try to save it on another location until next version.
Also, if you're on the insider build of vscode you have a different path:
# OS X
/Users/USERNAME/Library/Application Support/Code - Insiders/User
I find code-settings-sync excellent 馃帀 but I wish I could've disabled sync of projects_cache_git.json as it both reveals which projects I'm working on and wrongly syncs this onto machines which may be using a different path. From my syncSummary.txt:
Files Upload.
extensions.json
projects.json
projects_cache_git.json <--------- I wish to disable sync of this
settings.json
vsicons.settings.json
This will be the format for local settings file for the extension where you can set this.
{
"ignoreFiles": ["projects.json","projects_cache_git.json"],
"ignoreFolders": [
"workspaceStorage"
],
"ignoreCodeSettings": [
{
"name": "files.autoSave",
"value": "afterDelay"
}
]
}
When the value is empty for the nameValue Pair in the ignoreCodeSettings. Extension will remove that key from the downloaded settings.json file is there is any value. It will add that local value in the settings.json file.
ignoreFiles will be from User folder
ignoreFolders will be any folder inside User folder
When the extension is installed, it will add syncCustomSettings.json file for these features.
If anyone from you guys are using insiders version please let me know, i can release this for insiders before public release else if there is no one i will release publicly after testing myself.
If you like, I could try this with insiders.
Do you mean to say this would make sync-settings ignore backing up and restoring the projects cache?
"sync.ignoreFiles": ["projects_cache_git.json"]
"sync.ignoreFiles"
No, i dont think its necessary to put the above files with "sync." > in settings.json
New file inside users folder will be created with the name syncCustomSettings.json
For example in Computer A, in which you have "ignoreFiles": ["projects.json","projects_cache_git.json"] in syncCustomSettings.json inside user folder, these files wont upload in GIST so wont have backup, in computer B when you download this file wont be downloaded in computer B as its not inside GIST
I will push a version for insiders tomorrow and let you know =) and Thanks!
@fredrikaverpil I have pushed a version fixing this issue for Insiders, release notes and explanation is not made available in docs. Please have a look on above post for details
If all worked well, i will release to public with complete guide.
Ok, I just gave this a try and I think there are some problems.
I did not get a syncCustomSettings.json file created when updating the extension or by uploading/downloading the settings.
I created one manually with the contents you posted. Then after having uploaded/downloaded the settings I now also see that a syncLocalSettings.json file was created with these contents:
{"ignoreUploadFiles":["projects.json","projects_cache_git.json"],"ignoreUploadFolders":["workspaceStorage"],"replaceCodeSettings":[]}
Please note that this JSON is not the same as you previously posted. The keys are named slightly different.
However, it is only the syncCustomSettings.json file which gets uploaded onto the gist.
Is this behavior intended?
To me it seems that syncCustomSettings.json is being uploaded but it is syncLocalSettings.json which is actually being read by the extension.
I also notice that after having reset (and not being able to enter both gist and token), I get this when I attempt to download my settings:

I believe you should be able to repro this like so:
User folder (mine is /Volumes/1TBDrive/Users/fredrik/Library/Application Support/Code - Insiders/User)This effectively renders the extension unusable.
Yes i had change the file let me write the detail here, keys are changed for better understanding:
Extension will only create the syncLocalSettings.json on code start and connect with it.
syncCustomSettings.json is changed to localSettings name so extension will think it as some JSON file and upload and download it also.
syncLocalSettings.json file wont be upload and download. Following are the keys or layout for the file.
{
"ignoreUploadFiles": [
"projects.json",
"projects_cache_git.json"
],
"ignoreUploadFolders": [
"workspaceStorage"
],
"replaceCodeSettings": [
{
"name":"http.proxy",
"value":""
}
]
}
U know first two files allows extension to ignore files and folders to UPLOAD
Third key replaceCodeSettings will be used to replace the key in the value after downloading the GIST.
For users who are using proxy in one computer and dont want to set proxy in second one after downloading or need to change the value for proxy.
They need to add value as
{
"name":"http.proxy",
"value":""
}
After downloading the settings, extension will check if the value is defined, it will replace the the http.proxy value to defined value in settings.json after downloading.
If the value is not defined as some user dont want to use proxy in Home computer but they have proxy in office computer and they upload from office and it will have proxy in GIST to remove it from Home computer to make it work, the value need to set as empty so extension will delete the http.proxy from the Home computer.
Hope This is better for understanding.
I believe you should be able to repro this like so
I have reset the extension and re installed the extension and hit download and added the GIST ID, Settings are downloaded successfully.
Can you please provide the console logged image from the console ?
Hope This is better for understanding.
Aha, yes I understand now. I was confused by the former post in the thread.
Can you please provide the console logged image from the console ?
For some reason, I do no longer get this error. I suspect that maybe I had been pasting the token into the field which was expecting the gist id.
To me, this all just works great now. 馃槃 馃憦
About replaceCodeSettings, how would you go about copy-pasting e.g. this from settings.json?
"python.pythonPath": "${env.HOME}/miniconda3/envs/pythondev_35",
"python.linting.pylintPath": "${env.HOME}/miniconda3/envs/pythondev_35/bin/pylint",
"python.linting.pep8Path": "${env.HOME}/miniconda3/envs/pythondev_35/bin/pep8",
"python.formatting.autopep8Path": "${env.HOME}/miniconda3/envs/pythondev_35/bin/autopep8",
"python.formatting.yapfPath": "${env.HOME}/miniconda3/envs/pythondev_35/bin/yapf",
Right now it seems you'd have to carefully reformat that into a list of dictionaries containing the name and value keys:
{
"replaceCodeSettings": [
{
"name": "python.pythonPath",
"value": "${env.HOME}/miniconda3/envs/pythondev_35"
},
{
"name": "python.linting.pylintPath",
"value": "${env.HOME}/miniconda3/envs/pythondev_35/bin/pylint"
},
{
"name": "python.linting.pep8Path",
"value": "${env.HOME}/miniconda3/envs/pythondev_35/bin/pep8"
},
{
"name": "python.formatting.autopep8Path",
"value": "${env.HOME}/miniconda3/envs/pythondev_35/bin/autopep8"
},
{
"name": "python.formatting.yapfPath",
"value": "${env.HOME}/miniconda3/envs/pythondev_35/bin/yapf"
}
]
}
It would've been very helpful to just be able to copy paste from settings.json into replaceCodeSettings.
But all in all, the features works perfectly fine without issues for me. Awesome job!
It would've been very helpful to just be able to copy paste from settings.json into replaceCodeSettings.
Please open a new issue with your ideas 馃槃 to do such task.
As this works, i'm going to push newer version for public in few hours.
Thanks for your time =)
Please open a new issue with your ideas 馃槃 to do such task.
Ok! 馃憤
As this works, i'm going to push newer version for public in few hours.
馃榾 馃帀
Public build released v2.4.4.
Closing this issue. Feel free to let me know about any problem.
This was v2.5-worthy :) Nice feature.
This was v2.5-worthy :)
Yes i forgot this idea though, i already decided to push newer version just to inform all the users about it as v2.4.4 is just to target the smaller audience :) if there is no error i will push v2.5 by integrating it more with menus and more options.
Like the issue you have mentioned https://github.com/shanalikhan/code-settings-sync/issues/229 and https://github.com/shanalikhan/code-settings-sync/issues/225
Just a quick question about this feature: can replaceCodeSettings be set up so that it doesn't even upload the real value? I understand that the download direction is more important but for example if some value changes rapidly, having it entirely removed from the uploaded file (or replaced with some placeholder value) would prevent the Gist from having many useless revisions.
Please post a new issue for it and we will see about it
@shanalikhan Done, https://github.com/shanalikhan/code-settings-sync/issues/232.
Most helpful comment
It would be great if we could exclude entire *.json-files. For example I use the extension alefragnani/vscode-project-manager and I sync my work machines settings with my private one. I'm happy to have all my settings in both environments but I don't need the projects.json which is created by the extension. I think there are other cases too.