share settings between linux and windows - visual-studio-code

I have a question: I would like to share settings between two Visual Studio Code installations, one on Windows and another one on Linux.
Simply activating, the syncing of the settings is a bad idea since they contain platform-dependent paths, e.g., the location of the ssh config file. I did it and ended up with a broken VSC installation on linux: it could not find anything because the settings contained windows paths.
I ended disabling most of the syncings, up to the point where the syncing is useless.
Is there any way, a plugin, to easily share settings between installation on different OS platforms?

Related

Share VSCode data folder across OS systems

How can I share one Data folder between Windows and Linux Visual Studio Code on a multi-boot PC?
I want to have the same settings across both platforms, without having to set them up on each system individually.
VSCode on Windows (which is also downloaded as .zip so it's portable) stores all settings in a data folder, but I can't seem to make Linux version (downloaded as a portable .tar.gz file) use that same data folder that Windows version of VSCode uses.
What i mean by that, is when i make some setting change when i'm working in Windows, next time i boot up Linux, and start VSCode, i dont want to need to again change that same setting i applied on Windows VSCode already.
This is theoretically possible by using soft link on data directory, but it works partly.
Extensions are not loaded in Linux even if there is extensions folder in data folder, i downloaded some extension in Linux, and when i exit VSCode, extension disappears, while there are still some extensions in data from Windows VSCode.
I have custom theme in Windows VSCode, but it doesn't load in Linux at all.
I have online settings sync, but it doesn't sync everything. I want it to be synced by using literally same folder, so i don't feel any difference when switching OSes..

Visual Studio Code keeps changing my "python.pythonPath"

I have been using settings.json for a while now to share some project settings accross my different machines (which happen to be Linux, macOS and Windows). One of the settings I use is "python.pythonPath", which points to a interpreter inside the .venv created by the Poetry tool. Since Windows and linux-based operating system paths differ for virtualenvs, I need to set an environment variable with the proper path, e.g.: CLAYMEMOIRS_INTERPRETER.
I started noticing a problem where, whenever I launch visual studio code, my:
{
...
"python.pythonPath" : "${env:CLAYMEMOIRS_INTERPRETER}"
}
Gets automatically replaced with:
{
...
"python.pythonPath" : "c:\\GitHub\\claymemoirs\\.venv\\Scripts\\python.exe"
}
Which is the value of my environment variable. Anyone knows how I can prevent this behaviour? I did not do any updates or changed any plugins.
The problem persists, but newer releases indicate python.pythonPath is being deprecated in favor of python.defaultInterpreterPath. See here.
One of the reasons for deprecation is the questioned problem.
With the new python.defaultInterpreterPath set in the workspace settings file (.vscode/settings.json) you can use environment variables to set the project .venv path in a OS independant manner "${workspaceFolder}${env:CLAYMEMOIRS_INTERPRETER}". When someone from the team loads opens the project's folder in VSCode, the interpreter will appear on the selectlist, allowing developers to select the project interpreter without messing with other people's interpreters and, without changing the workspace path.

C/C++ Code navigation not working in vscode remote development

Tried to access a remote project (from Linux environment) over vscode remote development environment, followed all the necessary steps mentioned in https://code.visualstudio.com/docs/remote/remote-overview, Able to see the files and folder structure but unable to navigate the source code. Tried "Goto Definition"(F12) and Ctrl+ Click also not working
Tried to set max watch value to fs.inotify.max_user_watches=524288 still issue remain same
Once I reload the extensions it worked fine. I installed C/C++ IntelliSense from Microsoft and Austin

Multiple configurations for VSCode

At the moment I'm working on a few projects at the same time using VSCode, one in react, another in angular and some good old javascript.
The problem is that I have a few extensions installed that conflict, for example, some code snippets that are the same for React and Angular.
Is it possible to have 3 visual studio code installed on a Mac with different extensions installed?
There are two options for such setup:
Portable installation - unzip VSCode in a folder and create a subfolder there called data. This will trigger the portable mode and all settings will be stored in that data folder. The downside is that you'll have to manually update every portable folder whenever new version comes out. More info here.
Custom config paths - create a shortcut for your VSCode installation, and add those parameters:
--user-data-dir <some-path> --extensions-dir <some-path>
You can put them wherever and have as much shortcuts as you want, they even run in parallel. Best part is once you update the installation, all the configs are upgraded too. More info here.
Both modes are incompatible, so you have to choose one.

Difference between the appDataPath and extensions location in VS Code

Why do the VS Code extensions live at a different location than any other user preferences/settings?
According to the getAppDataPath logic in VS Code, the user-defined settings, such as the settings.json, keybindings.json, etc. go under:
/Users/You/Library/Application Support/Code/ (on macOS),
C:\\Users\\You\\AppData\\Roaming\\Code\\ (on Windows), and
/Users/You/.config/ (on Linux)
But the extensions are under ~/.vscode/extensions on all supported platforms.
Does anyone know why don't they put the extensions under ${getAppDataPath}/extensions?
Thank you!
The answer to my question was posted here.
because the paths that you get from getAppDataPath are not for storing extensions, they are for configuration files
at least on Linux they use $XDG_CONFIG_HOME, which is intended for configuration files and not a bunch of extensions