Scorb
Scorb

Reputation: 1850

Visual studio code package control (extension list)

I am curious if visual studio code has any behavior or plugin that behaves like Sublime Text package control plugin.

The specific behaviour I am looking for, is a text file that lists all currently installed plugins (extensions). You can then drop that package control settings file into any new install of sublime, and it will automatically install the listed plugins.

I check this plugin config file (along with my user dir) into git.

Then all I need to do is check out the repo, and all of my plugins will be automatically installed.

It is also very nice that I can install a new plugin at work, and then just do a git commit, and then a pull at home, and I am off to the races.

I don't feel like the vscode command line tool can emulate this behavior, because it would be up to me to maintain the install script.

Upvotes: 0

Views: 1674

Answers (1)

Kapcash
Kapcash

Reputation: 6909

List all vscode extensions:

Since May 2016 update, vscode has a specific command line to export all installed extensions:

code --list-extensions

Refer to this thread.

Sync plugin:

You should take a look to this vscode extension to synchronise all your settings across multiple machines: Settings Sync

Possible custom solution:

There is no default behavior in vscode to handle what you look for exactly. Maybe you'll need to write some script by yourself!
Here is a guess:

  • Create a vscode task to update a file at each commit, writing the installed extensions list (using the command above), so that you have a trace of all your extensions on your repo
  • Create another task to wrap the npm install for example, and add an automatic script that install all extensions from the extensions list file.

Exemple in bash:

# store in a string all installation commands for each plugin.
cmd=${cat vscode-extensions | xargs -L 1 echo code --install-extension}
# run the commands
echo 'installing extensions'; eval cmd

Something like that should do the trick.

Upvotes: 1

Related Questions