美文网首页
Sublime Text 插件安装

Sublime Text 插件安装

作者: 咕嘟咕嘟li | 来源:发表于2017-01-28 20:42 被阅读78次

    可以安装package control (https://packagecontrol.io/installation) 组件,然后直接在线安装:
    按住 ctrl+`二键调出Sublime 的console面板,或者单击View -> Show Console,在控制台输入以下代码:
    Sublime Text3:

    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)
    

    Sublime Text2:

    import urllib2,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; 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')
    

    如果package control组件安装成功后 Preferences 下会出现 Package Control这一项。
    按住Ctrl+Shift+P调出命令面板,输入install,选择install Package这一项

    Image1.png
    点击进入后就到下面这个界面,根据自己的需要选择插件下载就好了
    Image2.png

    相关文章

      网友评论

          本文标题:Sublime Text 插件安装

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