之前一直把ST当成一个普通的编辑器来使用,殊不知,小瞧了它,好像还可以搭建C++开发环境,下次再试着搞搞,接下来是关于Sublime Text3插件的安装:
Sublime Text3安装
官网下载就ok,此处不赘述。地址:https://www.sublimetext.com/3
Package Control管理器
这是一个插件管理器,先安装它,有了它,在ST中按Ctrl+Shift+P,输入Install或Remove后,就可以随便安装、卸载各种扩展了,包括各种ST的插件、主题等等。
安装步骤:
- ST中按Ctrl+`(或者菜单选择View > Show Console)进入ST的控制台
- 输入以下命令,回车
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')
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)
注:注意ST版本,Sublime Text2和Sublime Text3的命令不同,命令不匹配可能会报异常:ImportError: No module named request
另一种安装方法:
- Click the Preferences > Browse Packages… menu
- Browse up a folder and then into the Installed Packages/ folder
- Download Package Control.sublime-package and copy it into the Installed Packages/directory
- Restart Sublime Text
插件安装
Package Control安装完成按Commit + Shift + P快捷键进入插件管理,如图所示
输入 install 选择Package Control:Install Package选项进入安装插件
- 在这里输入你想要安装的插件名字回车安装就行了