In Sublime Text 2, I am trying to type the code and have auto format command to rearrange and auto indent source code. If it is not possible to have a automatic formatter, would be nice to have a shortcut command to do it.
I am searching for something else besides the built-in "Reindent" option and the hard-to-make-work "PHP Beautifier" plugin.
I would like to know if someone found any nice auto formatter for PHP: any formatter that won't mess our PHP code. JSFormat seems to be not useful.
Is there any easy to "install and use" plugin?
PHPTidy is definitely good choice for PHP code formatting in SublimeText2.
You need to install package control package to enable you to install packaged in sublime text: link.
ctrl+shift+p -> type -> Package Control: Install Package
search for phpTidy -> hit enter
that is it - now you can format your code in WordPress coding convention.
- ctrl+shift+p -> type -> tidy -> Hit Enter
- ctrl+alt+t
Hope this help.