Skip to content

Instantly share code, notes, and snippets.

@ubermuda
Created March 19, 2009 17:31
Show Gist options
  • Save ubermuda/81955 to your computer and use it in GitHub Desktop.
Save ubermuda/81955 to your computer and use it in GitHub Desktop.
au BufWritePre *.php call CheckLint()
function! CheckLint()
let l:response = system('/usr/bin/php5 -l '.expand('%'))
if match(l:response, 'No syntax error') == -1
echo l:response
throw 'Parse error !'
end
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment