Gabriel
Gabriel

Reputation: 42349

Export list of installed packages in SublimeText

I am aware that I can see all installed packages in Sublime using Ctrl+Shift+P and selecting Package Control: List Packages.

I have many packages installed (>20) and I need a way to export their names (and ideally also the link to their https://packagecontrol.io/ page) to a text file or similar output.

Can this be done at all?

Upvotes: 26

Views: 8511

Answers (2)

user6330630
user6330630

Reputation:

The accepted answer unfortunately didn't work for me. Then I found that in Windows 10 (at least for ST 3) you can obtain what you want by listing the files contained in

C:\Users\<your_user_name>\AppData\Roaming\Sublime Text 3\Installed Packages

But some installed packages might be missing from this list ! Crosscheck your result with the content of the directory

C:\Users\<your_user_name>\AppData\Roaming\Sublime Text 3\Packages

Upvotes: 0

Keith Hall
Keith Hall

Reputation: 16085

You can easily get the list of installed packages by looking at Package Control's user preferences file: Preferences -> Package Settings -> Package Control -> Preferences - User and checking the installed_packages value.

Getting the URL as well is a bit more complicated, but can be done for example by executing the following in ST's Python console (View menu -> Show Console):

import os; [(os.path.dirname(file)[len('Packages/'):], sublime.decode_value(sublime.load_resource(file))['url']) for file in sublime.find_resources('package-metadata.json')]

Upvotes: 49

Related Questions