This guide is deprecated. New content at docs.sublimetext.info
Packages are simply directories under Packages. They exist mainly for organizational purposes and have no bearing in how resources within them work except in a few cases that will be explained later.
This is an exhaustive list of Sublime Text resources than can be found inside a package:
- build systems (.sublime-build)
- key maps (.sublime-keymap)
- macros (.sublime-macro)
- menus (.sublime-menu)
- plugins (.py)
- preferences (.tmPreferences)
- settings (.sublime-settings)
- syntax definitions (.tmLanguage)
- snippets (.sublime-snippet)
- themes (.sublime-theme)
Some of them may include support files for other packages or built-in functionality too. Such is the case of the dictionaries used by the spell-checker (e. g. Packages\Language - English).
In order to talk about packages, we’re going to divide them in groups:
Let’s emphasize that this artificial division is for the sake of clarity in this guide. Sublime Text makes no distinction between these types of packages internally.
Sublime Text keeps a copy of all installed packages so it can recreate them when needed. This means it will be able to reinstall core packages, shipped packages and user packages alike. However, only user packages installed as a sublime-package are added to the registry of installed packages. Packages installed in alternative ways will be completely lost if you delete them.
To revert Sublime Text to its default configuration (plus installed packages), delete the data directory and restart the editor. Keep in mind, though, that Packages\User is not an installed package and you will lose its contents if you delete it.
In any case, make sure to back things up before taking an extreme measure like this.
There are three main ways to install packages:
- .sublime-package archives
- version control systems
- copy-pasting of files
Ultimately, installing a package consists simply in placing the directory containing Sublime Text resources under Packages. The only thing that changes from one system to another is how you copy these files.
If you’re running a full installation of Sublime Text, simply double-click on the .sublime-package. Sublime Text will take care of the rest.
If you’re using a portable installation, copy the .sublime-package to the Data/Installed Packages directory manually and restart Sublime Text.
Explaining how to use version control systems (VCSs) is outside the scope of this guide, but there are many user packages available for free on public repositories like Google Code, GitHub and Bitbucket.
Simply copy and paste a directory containing Sublime Text resources to the packages folder.
There’s little invisible magic involved in the way Sublime Text deals with packages. One notable exception is that macros defined in any package appear under Tools | Macros | <Your Package>.
As mentioned at the begninning, however, there are some packages that Sublime Text treats especially. For instance, Package/User will never be clobbered during a software update.
Packages/Default and Packages/User also receive a special treament when merging files (e. g. .sublime-keymap and .sublime-settings files). Before the merging can take place, the files have to be arranged in an order. To that end, Sublime Text sorts them by name, but files contained in Default and User are special: Default will always go to the front of the list, and User to the end.
You will find this directory in the data directory. It contains a copy of every sublime-package installed. Used to restore Packages.
You will find this directoy in the data directory. It contains a copy of every shipped and core package. Used to restore Packages.