checksyntax – Check for syntax erros when saving a file (php, ruby, tex …) : vim online
The checksyntax plugin runs an external syntax checker for the current buffer whenever the buffer is saved (by calling the |:CheckSyntax| command). Syntax errors are managed as location or quickfix lists. If any syntax error occurs, the |location-list| is opened (users can redefine |CheckSyntaxFail()| to change this behaviour). You can use any |location-list| related command to navigate the list of syntax errors.