I am using sublime text version build 3059 on ubuntu 14.04. I want to install php tidy in my installed sublime. So can someone tell me how to install php tidy. I am using sublime text for the first time so I don't know how to install plugins and repositories in it. So any help and suggestions will be really appreciable. Thanks
To install plugins, also known as packages, you'll first need to install Package Control. Go to the ST3 installation page and follow the Simple Installation Instructions very carefully. I have not copied the installation code here, as it changes with different releases, however the link I gave should remain constant. Once you've pasted the code into your console and hit Enter, and you've received the confirmation message, quit Sublime completely, then restart it. Basic usage instructions are here.
OK, this is the part where I'd usually tell you to open the Command Palette, find
Package Control: Install Package
, scroll through the list, pickPhpTidy
, and install it easily. Unfortunately, due to the laziness of the author, we can't do it that way, as the Package Control database currently only lists the plugin as working with Sublime Text 2, even though it's been updated (nearly a year ago) to work with ST3. This means we can't install it the usual way. There's also a file in the repository that needs to be deleted, otherwise it may not work. This won't be too hard, so don't get scared, it's just a little command-line work.First, open up your favorite Terminal emulator. If you installed 14.04 with all the default options, you'll find a button on the top left of the icon toolbar that looks approximately like this:
Click it, and type "Terminal" into the search box. The cleverly-named Terminal application should show up, and you can just click on it to open it. If you're a pro command-line user, I apologize for going through this step-by-step :)
NB: For all the commands below, it would probably be better if you copied them from your web browser and pasted them into Terminal (CtrlShiftV is the shortcut) instead of trying to recreate them by hand. Even a single-letter mistake could really mess up the process.
At the command prompt, double-check and see if you have a utility called
git
installed, by typingand hitting Enter. If
/usr/bin/git
shows up, great, just skip to the next part. If nothing shows up, or you get a message about installing something, type this next:and enter your admin user's password when prompted. This will install the utility we need for the next step.
OK,
git
is installed. Next, typeto change to that directory, which is where certain Sublime Text packages are stored. Then, enter
to pull the plugin files from Github and place them on your computer in a new
PhpTidy
directory. Finally, type into delete the file that may cause problems for you, and which has no right being in a repo anyways. You can now close Terminal.
Congratulations, the plugin is installed! To tidy your PHP code, just hit CtrlAltT.
Good luck!