Sometimes when I make coding mistakes I spend a lot of time finding the error.
Is there a plugin which makes Vim underline or highlight PHP, HTML or CSS mistakes?
For instance:
<?php
foreach ($row as $r) {
<echo '<h1>' . $r->title . '</h1>';
}
?>
The '<'
before echo will be highlighted in red.
Vim has HTML correction but I need for PHP and CSS.
There is plugin for Vim, developed by the infamous scrooloose, called Syntastic that does exactly what you are looking for. It is described as:
A syntax checking plugin that runs buffers through external syntax checkers as they are saved and opened. If syntax errors are detected, the user is notified and is happy because they didn't have to compile their code or execute their script to find them.
The syntax checker is extended with language plugins and there just so happens to be one for PHP as well as HTML, although I'm not positive about CSS at the moment. Either way, as soon as you open a file or attempt to save one that has syntax errors, you can set up Syntastic to alert 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 check out the helpdoc as there is a ton of useful info in there.
https://github.com/scrooloose/syntastic
This Runtime syntax check for php may help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With