## 一些有用的插件
---
插件管理:package control
2的pac 安裝
`import urllib2,os;pf='Package Control.sublime-package';ipp=sublime.installed_packages_path();os.makedirs(ipp) if not os.path.exists(ipp) else None;open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read())`
~~~
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)
~~~
主題切換:[Themr](https://github.com/benweier/Themr) [tm配色文件生成器](https://github.com/aziz/tmTheme-Editor)
html+js神器:[Emmet](https://github.com/emmetio/emmet) 、[Emmet中文文檔](http://www.iteye.com/news/27580)
版本控制:[SVN](http://sublime.wbond.net/svn)、 [TortoiseSVN](https://github.com/dexbol/sublime-TortoiseSVN)、 [gist](https://github.com/condemil/Gist)、 [git](https://github.com/kemayo/sublime-text-2-git)、[smartsvn](http://www.smartsvn.com/)
我們建立html文件時,做有些相同的代碼。 這時候我們喜歡能有一個代碼模板, 不能寫重復相同的代碼, gist插件能實現代碼模板的功能。 它能見我們自己創建的代碼模板,代碼片段保持在github中的gist下。 [這里](http://lucifr.com/2012/03/07/sublime-text-2-plus-gist-equal-snippet-manager/)介紹了詳細的用法。
FTP相關:[SFTP](http://blog.wpjam.com/article/sublime-text-2-sftp)
web相關:[Web Inspector](http://www.html5cn.org/article-4982-1.html)、 [ColorPicker](http://weslly.github.io/ColorPicker)
文件管理:[SideBarEnhancements](https://github.com/titoBouzout/SideBarEnhancements)
對齊工具:[Sublime Alignment](http://wbond.net/sublime_packages/alignment)、 [Valign](https://github.com/jlong64/sublime_valign)、 [codealignment](http://jaylabs.sinaapp.com/Sublime%20Guide/Sublime%20Alignment) 只支持win
快捷鍵相關: [FindKeyConflicts](https://github.com/skuroda/FindKeyConflicts) [KeymapManager](https://github.com/welefen/KeymapManager)
代碼相關:
[wheelchange](https://github.com/matiaspub/WheelChanger)
[jQuery-snippets](https://github.com/aaronpowell/sublime-jquery-snippets)
演示
這個插件提供jQuery的提示功能,不過每次提示都需要快捷鍵ctrl+shift+p上查找,不過如果和CodeIntel插件(下面說到)配合使用能互補不足,因為兩個插件都有些jQuery代碼缺少。
[Clipboard History](https://github.com/kemayo/sublime-text-2-clipboard-history) 用法:按ctrl+shift+v
演示: 演示
粘貼板歷史記錄,方便使用復制/剪切的內容,快捷鍵ctrl+shift+v可調出該歷史記錄面板
[CodeIntel](https://github.com/Kronuz/SublimeCodeIntel)
演示: 演示
"codeintel_syntax_map":
{
"Python Django": "Python",
"php": "C:/wamp/bin/php/php5.3.13/php.exe"
}
代碼自動提示,支持大多數語言,能很好的提示大部分jQuery函數
SublimeCodeIntel 讓sublime跳轉到變量定義的地方
給Sublime Text 2安裝CTags插件
Xdebug 左家梓使用過有問題可以用它,不過建議用Netbeans自帶的
Thinkphp 本人編寫,實現了讀取官方文檔列表,采集手冊,去除項目(其實是打開目錄中)文件的bom頭,自動完成,讀取項目中數據庫配置后讀取Thinkphp風格表名的字段顯示(目前只支持,mysql,以后會支持其他),訪問在線api等。