Setting up Sublime2
According Wikipedia Sublime Text is a cross-platform text and source code editor, with a Python API. The chrome was inspired by Vim. Its functionality is also extendable with sublime-packages; Sublime Text is not open source software nor free software, but some of the extending packages have free-software licenses and are community-built and maintained.
Sublime Settings
For Moodle Development:
Preferences -> Settings (default or user)
Tab size and spaces:
"tab_size": 4,
// Set to true to insert spaces when tab is pressed "translate_tabs_to_spaces": true,
Sublime plugins for PHP and Moodle Development
For installing new plugins in Sublime2, the best way is to use the Sublime Package Control, see installation instructions
Trailing Spaces
A Sublime Text 2 and 3 plugin that allows you to highlight trailing spaces and delete them in a flash!
https://github.com/SublimeText/TrailingSpaces
Sublime PHP CS
PHP CodeSniffer, PHP Coding Standard Fixer, Linter, Mess Detector and Facebook Scheck Support for Sublime Text
I recommend to enable only the Linter and the PHP Coding Standard Fixer. Mess Detector and Scheck may help a lot but they not fit well with some Moodle coding rules.