快速安裝
最簡單的方式是通過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