由于各种访问原因,因此记录一下给自己使用,原文地址如下:
http://www.bonusbits.com/wiki/HowTo:Setup_Package_Control_for_Sublime_Text
Method 1 (Sublime Text Script)
This will not work if you are behind a proxy. If you're behind a proxy use Method 2.
- Open Sublime console
- CTRL+`
- Sublime Text 2
-
import urllib2,os; 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())); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')
-
- Sublime Text 3
-
import urllib.request,os,hashlib; h = 'eb2297e1a458f27d836c04bb0cbaf282' + 'd0e7a3098092775ccb37ca9d6b2e4b7d';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 elseopen(os.path.join( ipp, pf), 'wb' ).write(by)
-
- Restart Sublime
Method 2 (Manually)
If you are behind a proxy use this method. After installing then set your proxy settings
- Download plugin file
- Copy Package Control.sublime-package to the Install Packages folder under Sublime Text install folder.
- Windows
-
C:UsersusernameAppDataRoamingSublime Text 2Installed Packages
-
- Mac
-
sudo cp ~/Downloads/Package Control.sublime-package ~/Library/Application Support/Sublime Text3/Installed Packages/
-
- Windows
- Restart Sublime
相关文章:
http://blog.jobbole.com/82527/