This plugin checks for errors in your code while you write it. It requires a fairly new beta of Sublime Text X or 2 (after Jon included thread/set_timeout support).
It currently has a rather featureful, platform-agnostic plugin for Python lint highlighting, and a basic PHP plugin which just runs “php -l” and highlights the error line if it finds one.
It’s pretty fast. It outlines all lines with errors, and underlines the specific error(s) on each line.
It shouldn’t slow down the UI, even with large files (there’s a current bug which might cause this sentence to be incorrect, most especially with php lint on windows, but it should be fixed very soon)
It’s not perfect.
It fails to underline the actual problem in a few places, like after the first line of multiline function arguments.
It recalculates the entire file after any changes are made instead of just the modified scope.
It chokes on Python parsing errors (completely invalid syntax will underline the offset provided by Python and give the error, but no other errors will be shown until you fix the syntax error)
Fixes for all of these are planned in a future update - I’m working on my own ast parser with scope awareness, real line/column offsets, simpler code, more checked cases, and faster parsing.
However… even the current iteration is infinitely better than waiting till you run/test the code to see errors.
See the project on GitHub
Download the latest GitHub master
You just need to put the file sublimelint_plugin.py and the folder sublimelint directly inside:
-
OS X: ~/Library/Application Support/Sublime Text 2/Packages/User/
-
Windows: %APPDATA%/Sublime Text 2/Packages/User/
-
Linux: ~/.Sublime Text 2/Packages/User/
edit: sentence revisions, added text for php