我需要把我安装的所有扩展发给我的同事。我如何导出它们?
扩展管理器似乎什么也不做…它不会安装任何扩展。
我需要把我安装的所有扩展发给我的同事。我如何导出它们?
扩展管理器似乎什么也不做…它不会安装任何扩展。
当前回答
在windows下,我通常需要运行
cd C:\Program Files\Microsoft VS Code\bin
code.cmd --list-extensions
你不做的是运行Code .exe直接在C:\Program Files\Microsoft VS Code\
其他回答
转储扩展:
code --list-extensions > extensions.txt
使用Bash (Linux, OS X和WSL)安装扩展:
cat extensions.txt | xargs code --list-extensions {}
在Windows上使用PowerShell安装扩展:
cat extensions.txt |% { code --install-extension $_}
https://code.visualstudio.com/docs/editor/extension-gallery#_workspace-recommended-extensions
共享扩展列表的更好方法是为同事创建基于工作空间的扩展集。
在通过code——list-extensions | xargs -L 1 echo code——install-extension生成扩展列表后(在运行代码命令之前,检查您的$PATH包含Visual Studio code条目C:\Program Files\Microsoft VS code \bin\),运行extensions: Configure Recommended extensions (Workspace Folder) Visual Studio code命令(Ctrl + Shift + P)并将扩展放入生成的.vscode/extensions中。json文件:
{
"recommendations": [
"eg2.tslint",
"dbaeumer.vscode-eslint",
"msjsdiag.debugger-for-chrome"
]
}
其他答案需要发送一个文件,我认为这太繁琐了。如果您需要将所有扩展名发送到另一台计算机上安装,请使用以下方式列出您的扩展名:
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 ...
我已经开发了一个扩展,它将同步你所有的Visual Studio代码设置跨多个实例。
关键特性
使用你的GitHub账户令牌。 易于上传和下载一键。 保存所有设置和片段文件。 上传键:Shift + Alt + U 下载键:Shift + Alt + D 输入“同步”查看所有同步选项
它同步
设置文件 Keybinding文件 启动文件 片段的文件夹 Visual Studio代码扩展
详细文档来源
Visual Studio代码同步ReadMe
这里下载:Visual Studio代码设置同步
自动
如果你期待一个简单的一站式工具来为你做这件事,我建议你看看设置同步扩展。
它将允许
导出您的配置和扩展 与同事和团队分享。您可以更新配置。他们的设置将自动更新。
手册
Make sure you have the most current version of Visual Studio Code. If you install via a company portal, you might not have the most current version. On machine A Unix: code --list-extensions | xargs -L 1 echo code --install-extension Windows (PowerShell, e. g. using Visual Studio Code's integrated Terminal): code --list-extensions | % { "code --install-extension $_" } Copy and paste the echo output to machine B Sample output code --install-extension Angular.ng-template code --install-extension DSKWRK.vscode-generate-getter-setter code --install-extension EditorConfig.EditorConfig code --install-extension HookyQR.beautify
请确保已安装了代码命令行。如需了解更多信息,请访问CLI。