tags:

views:

101

answers:

3

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.

A: 

No. vim only has syntax highlighters, not syntax validators. It's about time you switch to something like Eclipse - it even has the VIM shortcuts extension now.

m1tk4
@m1tk4 Yes is a good idea but I'm not sure if I can survive without Vim's key bindings.
janoChen
Then [Eclim](http://eclim.org) could be of some use.
Drasill
-1, vim's syntax highlighting is flexible enough to catch this kind of issue. So a custom style to do this is quite feasible.
Michael Anderson
@michael anderson : Please read the question again - it was about AVAILABILITY, not feasibility. We all know you can build a kitchen sink in both vim and emacs.
m1tk4
@janoChen - vim key bindings is exactly what this extension does. Haven't used it myself but helped a friend ween of vim :)
m1tk4
@m1tk4 - the syntax highlighters for C/C++, PHP, HTML highlight certain kinds of syntactic errors. Saying that it doesn't have any syntax validators is misleading. Using that to then promote your editor if choice is obnoxious
Michael Anderson
@Michael Anderson - I think claiming that "highlighting certain kinds of syntactic errors" is syntax validation is even more misleading. Eclipse is an integrated development environment - calling it an "editor" is obnoxious. ;))))
m1tk4
+1 for Eclim, that should be an answer on its own. I haven't used it for PHP myself though so I don't know how well it works.
spacemanaki
+1  A: 

This Runtime syntax check for php may help you.

Tassos
A: 

Try a better IDE like Netbeans, Eclipse. They comes with lot of standard features and many plugins. (JetBrain's intellJ is another good option).

All these assumes you are on good hardware.. does not match lean and mean vim.

Jayan