[SublimeText] 安装包管理

由于各种访问原因,因此记录一下给自己使用,原文地址如下:

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.

  1. Open Sublime console
    CTRL+`
  2. Sublime Text 2
    import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path()os.makedirs(ipp if not os.path.exists(ippelse Noneurllib2.install_openerurllib2.build_openerurllib2.ProxyHandler()))openos.path.join( ipp, pf)'wb' ).writeurllib2.urlopen'http://sublime.wbond.net/' +pf.replace' ','%20' )).read())print'Please restart Sublime Text to finish installation')
  3. 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_openerurllib.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)
  4. Restart Sublime

 

Method 2 (Manually)

If you are behind a proxy use this method. After installing then set your proxy settings

  1. Download plugin file
    http://sublime.wbond.net/Package%20Control.sublime-package
  2. Copy Package Control.sublime-package to the Install Packages folder under Sublime Text install folder.
    1. Windows
      C:\Users\username\AppData\Roaming\Sublime Text 2\Installed Packages
    2. Mac
      sudo cp ~/Downloads/Package\ Control.sublime-package ~/Library/Application\ Support/Sublime\ Text\3/Installed\ Packages/
  3. Restart Sublime

 

相关文章:

http://blog.jobbole.com/82527/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值