sublime 安装packagecontrol 和phpfmt插件的方法
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学习网发布,如需转载请注明出处。