@linux1s1s
2016-12-27T11:05:10.000000Z
字数 2873
阅读 1387
Tools
2016-12
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
以后,傻瓜安装,默认是没有打开Package Control
的,那么安装Plugin就只能通过Manual的方式,通过手动下载Plugin到本地,然后通过手动安装即可,这种方式的具体步骤如下:
If for some reason the console installation instructions do not work for you (such as having a proxy on your network), perform the following steps to manually install Package Control:
- 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
通过Manual的方式安装Plugin是不是Low爆了,如果能通过指令的方式安装Plugin是不是很期待,辣么必须打开Package Control,接下来一起看看如何打开。
The simplest method of installation is through the Sublime Text console. The console is accessed via the ctrl+` shortcut or the View > Show Console menu. Once open, paste the appropriate Python code for your version of Sublime Text into the console.
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')
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)
请务必按照上面的版本对应不同的Python
,否则执行失败。
This code creates the Installed Packages folder for you (if necessary), and then downloads the Package Control.sublime-package into it. The download will be done over HTTP instead of HTTPS due to Python standard library limitations, however the file will be validated using SHA-256.
重启以后,preferences->Package Control 说明打开成功。
Through Sublime Package Manager
Through Sublime Package Manager
接下来配置快捷键:
配置如下:
[
{
"keys": ["ctrl+alt+f"], "command": "js_format",
"context": [{"key": "selector", "operator": "equal", "operand": "source.js,source.json"}]
}
]