Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (23 sloc) 1.49 KB

PHP code formatter for Sublime Text editor with phptidy

Sublime Text 2


This is a Sublime Text 2 plugin allowing you to format your PHP code.

It uses wp-phptidy, which is a little tool for formatting PHP code to conform the WordPress Coding Standards.

It is based on the phptidy script by Magnus Rosenbaum.

Modifications were made by Eoin Gallagher and described here:


ctrl + shift + P and type Tidy PHP, or you can use the ctrl + alt + T keybinding.


Custom settings file (for choosing between original phptidy and wp-phptidy) coming soon.

Known issues

Running phptidy on your file will clear all bookmarks and foldings.


Package Control

The easiest way to install this is with Package Control.

  • If you just went and installed Package Control, you probably need to restart Sublime Text 2 before doing this next bit.
  • Bring up the Command Palette (Command+Shift+p on OS X, Control+Shift+p on Linux/Windows).
  • Select "Package Control: Install Package" (it'll take a few seconds)
  • Select PhpTidy when the list appears.

Package Control will automatically keep Git up to date with the latest version.

If you have some problems or improvements with it, contact me via GitHub.

Jump to Line
Something went wrong with that request. Please try again.