官網(wǎng)地址:官網(wǎng)鏈接
INSTALLATION
Simple
The simplest method of installation is through the Sublime Text console. The console is accessed via the ctrl+` shortcut or the View > Show Console menu. Once open, paste the appropriate Python code for your version of Sublime Text into the console. ? ? ?
import urllib.request,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; 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)
Manual
If for some reason the console installation instructions do not work for you (such as having a proxy on your network), perform the following steps to manually install Package Control: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
Click the Preferences > Browse Packages… menu ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
Browse up a folder and then into the Installed Packages/ folder ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
Download Package Control.sublime-package and copy it into the Installed Packages/ directory ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
Restart Sublime Text ?
簡單的代碼安裝
使用Ctrl+`快捷鍵或者通過View->Show Console菜單打開命令行做院,粘貼如下代碼:
import urllib.request,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; 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)
此時如果順利的話咨跌,此時就可以在Preferences菜單下看到Package Settings和Package Control兩個菜單了
麻煩的安裝方法
可能由于各種原因,無法使用代碼安裝腊状,那可以通過以下步驟手動安裝Package Control:
1.點(diǎn)擊Preferences > Browse Packages菜單
2.進(jìn)入打開的目錄的上層目錄携御,然后再進(jìn)入Installed Packages/目錄
3.下載Package Control.sublime-package并復(fù)制到Installed Packages/目錄
4.重啟Sublime Text