标签:
最近学习python,看网上推荐用sublime text2挺方便,就学习了一下对sublime text2 安装插件,先放在这里,以备以后查找
根据晚上资料修改,原文请看这里
Python的自动补全插件推荐 JEDI, 写好之后可以直接按 Ctrl + B 解释执行.
1.安装Package Control (详细请点击)
# ctrl+`
# Sublime Text 2
import urllib2,os,hashlib; h = ‘eb2297e1a458f27d836c04bb0cbaf282‘ + ‘d0e7a3098092775ccb37ca9d6b2e4b7d‘; 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‘)
# Sublime Text3
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_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)
2. Install Package
#Ctrl+Shift+P =>Install Package =>JEDI
3.直接在配置文件中进行修改,sublime 会自动安装
#Package setting => Package Contral => setting-user { "in_process_packages": [ ], "installed_packages": [ "Alignment", "BracketHighlighter", "DocBlockr", "Emmet", "FileDiffs", "GBK Encoding Support", "Jedi - Python autocompletion", "jQuery", "JsFormat", "LESS", "Markdown Extended", "Package Control", "SublimeCodeIntel", "Trimmer" ] }
标签:
原文地址:http://www.cnblogs.com/roger9567/p/4511586.html