Sublime Text 官方介绍:
“Sublime Text is a sophisticated text editor for code, markup and prose.You’ll love the slick user interface, extraordinary features and amazing performance.”
Sublime Text 是一款优秀的轻量级编辑器,而且支持跨平台,支持Windows、Linux、Mac OS X 等主流操作系统。虽然是一款收费软件,但也允许人们无限期免费使用。(官方下载地址)
Sublime Text 具有漂亮的用户界面和强大可扩展插件功能,本文介绍如何安装 Sublime Text 插件。
打开 Sublime Text 编辑器的 Console(控制台)使用快捷键 ctrl+`
或者点击菜单 View > Show Console menu
打开 Console,如图:
Sublime Text 2 粘贴以下代码:
1 | 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') |
Sublime Text 3 粘贴以下代码:
1 | 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 即可,按下快捷键 ctrl + shift + p
,输入 pci
(Package Control Install 简写)如图:
敲回车即可打开插件安装界面,输入想要安装插件的名称即可开始安装,如图:
Sublime Text 插件安装介绍完了,需要注意的是安装过程中要保持网络畅通。