Package Control is a convenient package manager in Sublime Text that allows the user to find and install a package quite simply, as well as to remove it, upgrade it, switch it, and many other things. Below I will tell you how to quickly and easily install this add-on in Sublime Text.
Manual Installation
To install Package Control you should go to the official upload website page and download the file Package Control.sublime-package there. Then you should copy this file into the Packages/Installed Packages directory in the folder of the program profile. And you’ve done it! Package Control is now installed.
Automatic Installation
You can install Package Control a lot faster by inputting the appropriate command into the Sublime consoles (triggered with the combination of the shortcuts Ctrl+~).
Installation of Package Control for Sublime Text 2
You should open the console in Sublime Text. Click View > Show Console.
Place the line in the console:
1 | import urllib2,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation') |
Press Enter.
After the installation restart the editor.
Installation of Package Control for Sublime Text 3
Open the console.
Paste the code:
1 | import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by) |
Restart the editor.
The installation of Package Control is one of a few cases that require the restart of the program to apply the changes.
After you have installed Package Control and restarted Sublime, you can go ahead and use this function. Package Control can be accessed from the menu, but a much faster method is the Command Palette which has already been familiar to you. It is opened by using the hotkey Ctrl+Shift+P.
Each of the features in the available list speaks for itself so the work with Package Control is quite intuitive and easy to understand. For instance, when you select the feature “Install Package”, you will find a list of the packages available to install.
When you select the feature “Disable Package”, you will see a list of the installed packages and will be able to select one to switch off. When you select the feature “Enable Package”, you will see the list of the switched off packages and will be able to switch any of them on.
If there isn’t a package you need in the list of the available packages, but you have found its repository (for example, hosted on GitHub), you can add this repository by picking the feature “Add Repository”. Via Package Control you can install not only plugins to improve the Sublime functionality, but also algorithms of the syntax highlighting for a language you need, collections of snippets, theme formatting of the program and so on.