一.简易安装
打开Sublime text的console.打开console的快捷时ctrl+,或者在菜单栏点击
View->Show Sonsole`.打开后将下面的代码复制到console中,注意选择对应的版本。
Sublime Text 3
import urllib.request,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0'; 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://sublime.wbond.net/' + 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)
Sublime Text 2
import urllib.request,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0'; 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://sublime.wbond.net/' + 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)
这段代码将创建安装包文件到您的电脑(如果必要的话),然后下载Package Control.sublime-package
到Package文件夹中 。由于python标准卡的限制,下载是通过HTTP而非HTTPS.该文件已使用SHA-256进行验证.
二.手动安装
如果因为某些原因,上面的安装方法失败(如使用了proxy等),则可根据以下步骤进行手动安装。
1.点击Preferences > Browse Packages…
菜单
2.浏览文件夹,进入Installed Packages/
文件夹
3.下载Package Control.sublime-package
,并将其复制到Installed Packages/
目录.
4.重启Sublime Text.