情况描述:安装Sublime text3后发现Preferences下没有Package Control,或者误删除 了
重新安装Package Control方法如下:
一、View-Show Console 或者快捷键CTRL+` (ese按键下),打开sublime命令输入框,将下述代码粘贴到命令行中,直接Enter执行:
import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; 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 Control了;