How to transfer the VSCode extensions of one computer to another?

182 阅读1分钟

There are two methods to transfer the VSCode extensions of one computer to another:

Using Settings Sync extension

The extension is very powerful but its usage is not easy for newbies.

Using the VSCode builtin commands

On computer A:

➜  ~ code --list-extensions --show-versions | xargs -L 1 echo code --install-extension

code --install-extension albymor.increment-selection@0.2.0
code --install-extension pepri.subtitles-editor@1.1.6
...

Copy and paste the above echo output to machine B.

Press enter, the installation process begins:

Installing extensions...

Note: --show-versions is to clamp the version, so that the two computers have identical extensions installed.

Note: In the same way, follow the command below to uninstall all extensions.

➜  ~ code --list-extensions | xargs -L 1 echo code --uninstall-extension

If you are not familiar with code or xargs commands, just use code -h or man xargs to figure out.