当前位置:首页 > 软件开发学习 > Python学习 > 正文内容

sublime 安装packagecontrol 和phpfmt插件的方法

admin5年前 (2016-03-30)Python学习1768


packagecontrol  官方网站


所有的插件安装前必须有packagecontrol支持


he 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.



sunlime3的方法



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)


sunlime2的方法



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


安装 phpfmt的方法



Install this plugin through Package Manager.

  • In Sublime Text press ctrl+shift+P

  • Choose Package Control: Install Package

  • Choose phpfmt

Configuration (Windows)

  • Edit configuration file (%AppData%\Sublime Text\Packages\phpfmt\phpfmt.sublime-settings)

  • For field "php_bin" enter the path to the php.exe Example: "php_bin":"c:/PHP/php.exe"

Configuration (OS X and Linux)

  • Edit configuration file (phpfmt.sublime-settings)

  • For field "php_bin" enter the path to the php Example: "php_bin":"/usr/local/bin/php"

Settings

Prefer using the toggle options at command palette. However you might find yourself in need to setup where PHP is running, use this option below for the configuration file.

{
"php_bin":"/usr/local/bin/php",
}

The following features are available through command palette (ctrl+shift+P or cmd+shift+P) :

  • phpfmt: format now

  • phpfmt: indentation with spaces

  • phpfmt: toggle additional transformations

  • phpfmt: toggle excluded transformations

  • phpfmt: toggle skip execution when .php.tools.ini is missing

  • phpfmt: toggle autocomplete

  • phpfmt: toggle dependency autoimport

  • phpfmt: toggle format on save

  • phpfmt: toggle PSR1 - Class and Methods names

  • phpfmt: toggle PSR1

  • phpfmt: toggle PSR2

  • phpfmt: analyse this

  • phpfmt: build autocomplete database

  • phpfmt: getter and setter (camelCase)

  • phpfmt: getter and setter (Go)

  • phpfmt: getter and setter (snake_case)

  • phpfmt: generate PHPDoc block

  • phpfmt: look for .php.tools.ini

  • phpfmt: reorganize content of class

  • phpfmt: refactor

  • phpfmt: toggle PHP 5.5 compatibility mode

  • phpfmt: enable/disable additional transformations

  • phpfmt: troubleshoot information

  • phpfmt: update PHP binary path



扫描二维码推送至手机访问。

版权声明:本文由学无止境-开拓创新-ipvb学习网发布,如需转载请注明出处。

分享给朋友:

相关文章

学习PYTHON的几个中文网站

python中文网http://www.pythoner.cn/中谷教育python频道http://www.csvt.net/teampython爱好者http://www.pythonfan.or...

python学习网站www.liaoxuefeng.com

  用Python可以做什么?可以做日常任务,比如自动备份你的MP3;可以做网站,很多著名的网站包括YouTube就是Python写的;可以做网络游戏的后台,很多在线游戏的后台都是Python开发的。...

在Windows命令行中使用Python

  在Windows命令行中使用Python  如果你想要从Windows命令行调用Python,那么你需要先正确的设置PATH变量。  对于Windows 2000、XP、2003,点击控制面板-&...

python文档地址

文档首页https://docs.python.org/2.7/index.html教程地址https://docs.python.org/2.7/tutorial/index.htmlAn onli...

Python报错IndentationError: unindent does not match any outer indentation level

Python报错IndentationError: unindent does not match any outer indentation level

  IndentationError: unindent does not match any outer indentation level  应该是缩进问题,特别是把几个不同的源码拷到一块修改调式...

windows下面安装Python和pip终极教程

windows下面安装Python和pip终极教程

在大二的时候接触过一段时间的Python,最近又开始玩起了这门语言。总的来说,个人很喜欢Python的语言风格,但是这门语言对于windows并不算很友好,因为如果是初学者在windows环境下安装,...