我需要把我安装的所有扩展发给我的同事。我如何导出它们?
扩展管理器似乎什么也不做…它不会安装任何扩展。
我需要把我安装的所有扩展发给我的同事。我如何导出它们?
扩展管理器似乎什么也不做…它不会安装任何扩展。
当前回答
文件>首选项>打开设置同步将在不同的设备上同步你的VS Code设置。
我使用的是VS Code版本1.74.0
其他回答
其他答案需要发送一个文件,我认为这太繁琐了。如果您需要将所有扩展名发送到另一台计算机上安装,请使用以下方式列出您的扩展名:
code --list-extensions
你可以使用如下格式的单行命令安装多个扩展:
code --install-extension dakshmiglani.hex-to-rgba --install-extension techer.open-in-browser
一个简单的方法来格式化你的扩展列表来创建命令是做一个regex搜索和替换:
Paste your copied list into a new document and search for: (.+)(\n?) Replace with --install-extension $1 (Don't omit the space at the beginning.) Add the word code to the start of the resulting text and you'll have a very large command that you can hand off to your colleagues to run in their terminal. code --install-extension hbenl.vscode-test-explorer --install-extension maciejdems.add-to-gitignore --install-extension techer.open-in-browser --install-extension traBpUkciP.vscode-npm-scripts ...
有一个扩展管理器扩展,这可能会有所帮助。它似乎允许安装一组在settings.json中指定的扩展。
现在有一个功能仍在预览中,允许你用微软或GitHub帐户登录,并在没有任何额外扩展的情况下同步你的设置。这非常简单直接。你可以在这里了解更多。
你可以同步的东西。
我打开Visual Studio Code扩展文件夹并执行:
find * -maxdepth 2 -name "package.json" | xargs grep "name"
这将为您提供一个列表,您可以从中提取扩展名。
在windows下,我通常需要运行
cd C:\Program Files\Microsoft VS Code\bin
code.cmd --list-extensions
你不做的是运行Code .exe直接在C:\Program Files\Microsoft VS Code\