>PROBLEM
You need to work with different environments and workspaces for different purposes when working with different programming languages or different contexts.
For each context or environment, you've installed the desired extensions.
Also, it is interesting to keep a backup of the environment to save time.
What does happen next?
If you have just one configuration setup and many needs, the VS Code configuration begins growing, eventually getting heavy, slow, and taking too much memory.
Also, the extensions' default shortcuts begin to conflict with each other.
>SOLUTION
There are at least three approaches:
1. Versioning control using branches, or
2. Separate configuration folders, or
3. Option 1 plus option 2.
Versioning control using branches
The VS Code default folder that holds its configuration setup is under
"C:\Users\YOUR_LOGIN\.vscode" folder.
Create a git repository there.
For each kind of environment desired, create a specific branch.
The master branch would aggregate everything, but in this case, there is no use unless you do want to keep a backup of just one setup.
Separate configuration folders
The default folder is at:
%USERPROFILE%\.vscode\extensions
Before creating the symbolic link, move the default extension folder to the new place desired, then create it:
mklink /D %USERPROFILE%\.vscode\extensions "NEW_PATH_DESIRED\extensions"
Ex.:
mklink /D C:\Users\YOUR_USER\.vscode\extensions "D:\ide_home\vscode\Code\extensions"
Option 1 plus option 2
You may combine the two options above, but better if the branches keep a keyword to avoid losing control.
The best of all is that you never lose your env, never need to reconfigure, and may switch fast the environments preserving then VS Code app from getting messed and slow.
No comments:
Post a Comment