Blog: PHP, Python, Linux, Web services & Continuous delivery

SublimeText2 development setup

sublime text 2 dev setup

On upgrade to V2.0 I had issues with some of my favorite plugins so I’m starting again and writing down what I do this time. There are a few steps involved but it is worth the effort, you may have to occasionally restart the editor after installing a plugin in order for it to become available to use.

I#ve split the plugins I use into two categories: General and PHP specific

General plugins

> Package control

Install Package Control first, after that all plugins can be installed easily via the PackageControl interface, which you can get to from the main menu > Preferences > PackageControl.

> soda theme

A nicer display than the standard theme. Once it is installed you have to enter the following in your user settings file.

"theme": "Soda Dark.sublime-theme",

> whitespace corrector

Eliminates annoying trailing whitespace on the go but still manages to treat 'tabs as spaces' correctly. There is also an option to trim all unnecessary whitespace by right clicking in the main text editing area and selecting 'whitespace corrector'.

> SideBarEnhancements

Adds Copy, paste and move functionality (along with a few other bits) into the side bar. It's surprising that this functionality is not included by default really but whatever.

> goto_documentation

Jump to the documentation for the current word. Supports PHP, JS / CoffeeScript, Python, Clojure, Go, Smarty, Ruby on Rails. You may also need to add the following key binding to your user key bindings file:

"keys": ["super+shift+h"], "command": "goto_documentation"

PHP specific plugins

> phix colour scheme

Good php syntax highlighting using earthy colours.

> DocBlockr

PHP and JavaScript automatic comment generation. You type /** and it does the rest. So far it Seems to make fairly intelligent guesses about return values, parameter types etc. Not quite as good as the eclipse PDT equivalent but still saves a hell of a lot of time.

> sublimeLinter

Adds php syntax checking ( also has support for some other languages). This plugin uses the system PHP installation and runs the command 'php -l' to actually perform the lint operation.

> phpunit

Allows you to run phpunit tests directly within SublimeText2.

comments powered by Disqus