快速安装
最简单的方式是通过Sublime Text 3的console命令界面进行安装
使用 ctrl+~快捷键 或者 菜单项View > Show Console 来调出命令界面
然后复制粘贴下面的Python代码到命令输入框中:
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的Package Control的安装代码
import urllib2,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0'; 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://sublime.wbond.net/' + 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')
手动安装
可能会由于你所在的网络通过代理访问而导致安装失败,你可以通过下面的步骤来手动安装
-
点击菜单Preferences > Browse Packages…
-
-
然后打开上一级文件夹到已安装的Packages所在文件夹 Installed Packages
-
从 https://sublime.wbond.net/Package%20Control.sublime-package 下载后,复制该文件到上面打开的目录
-
重启Sublime Text,完成对Package Control的安装
附原始手册地址https://sublime.wbond.net/installation#st3