Sublime Text 2 learning

Instead of using VIM, I find another awesome editor which might replace VIM.It's called Sublime Text 2. Heard it from Garreot before but I did not pay attention to it. Now, I decide to take it as my default editor, especially for javascript.

? How to install widgets?

A: search on Internet and find a snippet code of installing "package control". Use keys "ctrl + `" to open the console and copy the code then make it run. After it's done, quit the ST2 and reopen it, use keys "ctrl+shift+P" and type "pci". Choose package control:install then you can find those widgets you want, such as JSFormat, Docblockr, zencoding, etc.




Sublime Text 3: 注意空格!!自己手动删空格吧

import urllib.request,os; pf = 'Package Control.sublime-package'; ipp =
sublime.installed_packages_path(); urllib.request.install_opener(
urllib.request.build_opener( urllib.request.ProxyHandler()) );
open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen(
'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())


Sublime Text 2:

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')


你可能感兴趣的:(js,st2)