Sublime2 for Mac OSX(Python developer)
團隊對代碼規範要求越來越高了之後,我就必須用到AutoPEP8之類的插件了。
雖然Vim很流行,但是調配起來還是有點麻煩。看到又輕又強的Sublime之後,就決定把它作爲主編輯器了。
必裝的一個插件管理器:
1、Package Control
主頁:https://packagecontrol.io/installation
安裝:快捷鍵ctrl+` 或者View > Show Console menu
import urllib2,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; 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')
把上面這段粘貼進去,回車,成功後會顯示:Please restart Sublime Text to finish installation
重啓後,Command+Shift +P快捷鍵可以打開包管理器(前提是Package Control已經安裝成功)
選擇Package control:Install Package。
跳出輸入框之後往裏面輸入插件名字,就可以安裝了。
常用的兩個插件:
1、AutoPEP8(快速格式化代碼)
2、SublimeCodeIntel(多種代碼自動補全)