美文网首页
Mac 配置sublime package control

Mac 配置sublime package control

作者: azhengQ | 来源:发表于2019-05-25 11:55 被阅读0次

    Mac安装配置sublime

    sublime安装Package Control

    • 方法一
      通过Sublime Text console安装。

      • 通过View>Show>Console菜单打开console或者
      ctrl+`
      
    • 打开后复制粘贴下列代码到console

      sublime text3
      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)
      sublime text2
      import urllib2,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; 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://packagecontrol.io/' + 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')

    • 方法二</br>
      如果方法一无法执行成功,就手动下载Package Control.sublime-package</br>

      • 下载Package Control.sublime-package
      • 点开Preferences>Browse Packages菜单
      • 找到上一层目录,找到Installed Packages文件夹,将刚才下载好的文件复制进去
      • 重启sublime

    如果顺利的话,输入command+shift+p,然后输入install package,再输入想要安装的插件即可下载

    然而通常情况下是不行的,可能会出现There are no packages available for installation

    相关文章

      网友评论

          本文标题:Mac 配置sublime package control

          本文链接:https://www.haomeiwen.com/subject/gwpazqtx.html