Today the system has a little trouble, restore once, all kinds of software!! Found that every time you install VScode have to reinstall all the time, still have to find on the Internet that plug-in (I can’t remember the plug-in name), then I think Microsoft created such a big company have a code editor first installed directly uploaded to the cloud (hosting, like the yards cloud, making, and so on), while waiting for the next installation, Directly from the cloud one key download/and install the initial need for those extensions, the heart is not as good as action, I asked baidu, found that there is really, at that time ao baiao baiao bye bye!! After reading the online tutorials, I found that they were using an old version of the sync extension, which was not quite the same as what I had installed, so I made my own modifications, and my efforts paid off!

Write down how you did it in case you forget it later. ,, can follow me to do this, I use the most concise, the most detailed steps to explain (of course enough, I did not go so far into this extension, as long as one key sync on the line).

Ok, Action.

First of all, go to the official website of vscode to download vscode.

Download link: code.visualstudio.com/

Second, you need to search vscode for the Settings Sync extension, which is used for one-click upload/download. (The first one is, the arrow points to) as shown here:



3. Create a Gist token on Github.

First, log in to giHub, as shown below:



As you can see, this is the home page on my GIhub! (My Github is the code for some exercises.)

Then, click an avatar in the upper right corner, click it or click the down arrow on the right of the avatar, and a menu will appear, as shown in the picture:



Select the next-to-last Settings option and click. This will redirect to your Settings page, as shown below:



You can see the blue menu bar on the left and the corresponding options on the right!

Select Developer Settings from the left menu bar and create a Token. Click on it. The page looks like this, as shown in the picture:



Go here and select Personal Access Tokens (the blue word on the left menu bar is the last one). Click on it and you will see a page like this:



Here is a list of tokens I have used before!

We found the “Generate new Token” option on the top right, click it, and the following page appears, as shown in the picture:



In the input box is the name to create, which is arbitrary, as long as it meets the specifications. As for the following options, we can look down and find the option named gist. Just find the GIST option, check on (select on), and click the green button below to Generate token, as shown in the figure:



The one with the green check mark in front is the token I created just now, because this token is random, so it is different!

Then we record the token! This token will not be visible after we refresh the page, so record it! You can create a document text to record, and you need an ID below, so it’s best to create a record (in case of loss)!!

Step 4: after you have the token, go back to vscode and configure the token.

First, we need to find the Appdata folder in the personal username folder (in my case)

C:\Users\jiazhuangme\AppData\ Code\User



As you can see, I have three folders and three JSON files, which are usually available when you start up. One of these folders is called SyncLocalSettings. JSON, which is generated after installing the Settings Sync extension (folders can be deleted, After the JSON file is deleted, however, you need to reinstall the extension, which is automatically generated.

JSON file, which can be opened with vscode or dragged into vscode. The open file looks like this, as shown below:



We found the token properties in the JSON file, filled in the token properties we created from github (copy and paste), Ctrl + S to save, now we need to restart vscode to make the JSON file effective!

Next, after rebooting, press Ctrl + Shift + P on Windows and press this key combination to bring up the Command box, as shown in the following image:



I’ve configured it here, so the menu will be different, but that’s ok, we need to type sync in the search box, as shown here:



Select Sync: Advanced Options (Sync: Advanced Options). Advanced Options, because I have configured it, so this option is in the first item), the interface after appearing is shown as follows:



After selecting the option “Sync: Open Settings”, this interface appears, as shown in the picture:



Gist ID is the Gist ID, but don’t fill in the token. This will prompt you that the ID is invalid. The first line on the right is the token in the JSON file property we just configured. It can be seen that it has taken effect. Where can I get the ID? Don’t worry, let’s get the ID!

Let’s press the shortcut key Shift + Alt + U and upload all the VScode extensions we installed. Wait patiently for the uploading to be successful. After that, the uploading information will pop up automatically on the VScode console, as shown in the picture:



You can see, I here is the upload success! Finally, the Done prompt!

Note: after Done, VSCode will pop up a Sync ID prompt box in the lower right corner, asking you to save the ID. If you are careless and cross the prompt box, you can enter Sync in the search box in the Settings, and the ID you just uploaded will appear as shown in the picture:



The red circle is the ID we just uploaded, don’t believe it? Can try ha!

So now we have the ID and the token, the token setting is done, and the ID setting is left.

If you do not believe that all uploads have been successfully completed, you can check the name of the uploaded extension in the console message to see if it matches the name of your local extension. Another method is to check the page on Github after the token is created, as shown in the following figure:



Here is the previous token, for the sake of demonstration, I have just created the token deleted.

You can see on the left is the name of the token (GIST) that you created, and on the right is the description that says “Used never” if you didn’t upload successfully. And I’ve already used this description.

If you have other ways to tell if you are successful, leave a comment in the comments section!! So far I’ve found both!

Next, we configure the last step, which is to configure the ID.

Ctrl + Shift + P -> Enter Sync -> Select Sync: Advanced options -> Select Sync: Open Settings, as shown in the picture:



Remember when we said ID was missing, the input field was empty?

Now that we have the Gist ID, we can paste the same ID into the Gist ID input box on the left. Once you’ve filled it in, there’s a big check sign in the bottom left corner.

⑤ Next, let’s test whether we can upload with one click!!

First, we find a folder with a.vscode extension under the personal username folder. If you don’t see this extension, you can go to the menu bar and click View -> check hidden items, and then we will see it.

Then go to the extensions folder under vsCode and Delete all the extensions in this folder (this is all the extensions installed by VSCode), Ctrl + A -> Delete to remove them!



To show you again, I have deleted all of them!

Next, restart vscode and install Settings Sync. After the installation, set up the extension and configure the token and ID that we created earlier. I won’t bother you here.

Once configured, in the VSCode interface, press Shift + Alt + D to download all the extensions we uploaded (Shift + Alt + U is the upload command) and wait for all the extensions to download/install. As shown in figure:



As you can see, we are downloading/installing all the extensions we uploaded earlier!

High energy ahead!!

C: Users\jiazhuangme\AppData\Roaming\Code\User As for why delete, that is because, we just configured, when on another computer will not have this configuration, here just simulate the environment of the new computer!! We need special attention here!!

Here I show that the installation/download was successful, as shown in the figure below:



Let’s see if the vscode Extensions folder is installed successfully, as shown in the figure below:



Finally, check to see if the vscode extension is available, as shown below:



As you can see, I’ve installed everything here, so I don’t have to find a plug-in and install it again on another computer! Do you think it is very convenient, a little configuration can achieve this function, friends quickly try it!!

Special note: the above mentioned record token and ID, must be saved!

I recorded it in the text document (Notepad), as shown in the picture:



In this way, we can have token and ID, as long as we have these two things, it is very convenient to control upload/download, just like hosting your code with Github, upload/download at will. We can also upload this notepad to any cloud above, such as Baidu cloud, so you only need to download this important notepad on another machine can, do not worry about losing, must form the habit of frequent backup!!

This article is mainly to record the operation process, although a little wordy, BUT I believe that most people should understand! We can not understand on the Internet, must be their own tampering, tampering maybe became it!

(What if, as the saying goes, it happens?)

Tamp this, also have to tamp C language, to tell the truth, C language pointer is really a bit not quite understand ~~~