Sublime Text2插件之 - JSON格式化 mac

首先打开 ctrl+`, 并在打开的 st2 console 中输入:

import urllib2,os; 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())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print 'Please restart Sublime Text to finish installation'

JsFormat

用于格式化 javascript 的代码, 之后可以 cmd + shift + p 找 Format: javascript 就可以了.

再ctrl +A 全选   然后  ctrl + alt + f 就可已了

转载于:https://my.oschina.net/chinacaptain/blog/354072

你可能感兴趣的:(Sublime Text2插件之 - JSON格式化 mac)