Sublime Text 使用

作者: 牵线小丑 | 来源:发表于2016-05-28 11:52 被阅读142次

    记录 Sublime Text 的使用,不定时更新……


    安装 Package Control

    1. 打开菜单栏的 View > Show Console ,在底部出现的输入框中输入以下内容:
    * Sublime Text 3
    
    import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; 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 Text 2
    
    import urllib2,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; 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')
    
    1. 安装成功后使用 Shift + Ctrl + p,在弹出窗口中即可看到 Package Control 的相关内容。

    包安装

    1. SublimeJEDI:一个 Sublime Text 插件,用来使用超赞的自动补全库 Jedi。可以使用 Package Control 搜索并安装 Jedi - Python autocompletion

    2. Anaconda:Anaconda 把你的 Sublime Text 3 变成一个功能齐全的 Python IDE。可以使用 Package Control 搜索并安装 Anaconda

    设置 Sublime Text 作为 Git 编辑器

    • Mac:
    git config --global core.editor "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n -w"
    
    • Windows
    git config --global core.editor "'c:/program files/sublime text 2/sublime_text.exe' -w"
    

    参考

    1. Package Control

    相关文章

      网友评论

        本文标题:Sublime Text 使用

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