Is there any "code corrector" for Vim that highlights HTML, PHP, CSS errors?

Sometimes, when I make coding errors, I spend a lot of time finding an error.

Is there a plugin that emphasizes Vim or highlights PHP, HTML, or CSS errors?

For example:

<?php foreach ($row as $r) { <echo '<h1>' . $r->title . '</h1>'; } ?> 

'<' before the echo will be highlighted in red.

Vim has HTML correction, but I need PHP and CSS.

+7
html css vim php
source share
3 answers

There is a plugin for Vim developed by the infamous scrooloose called Syntastic , which does exactly what you are looking for. It is described as:

A syntax checker plugin that runs buffers through external syntax checks as they are saved and open. If syntax errors are detected, the user is notified and happy because they did not have to compile their code or run their script to find them.

Syntax checking is expanded by language plugins, and this only happens for PHP, as well as for HTML, although at the moment I'm not sure about CSS. In any case, as soon as you open a file or try to save one that has syntax errors, you can configure Syntastic to warn you in various ways:

 * A statusline flag appears when syntax errors are detected * |signs| are placed beside lines with syntax errors, where a different sign is used for errors and warnings. * The :Errors command is provided to open a |location-list| for the syntax errors in the current buffer 

Be sure to go to helpdoc, as there is a lot of useful information.

https://github.com/scrooloose/syntastic

+7
source share

This Runtime syntax check for php may help you.

+1
source share

Not. vim only has syntactic highlighting, not syntactic validators. This is the time when you switch to something like Eclipse - it even has a VIM shortcut extension.

-one
source share

All Articles