Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On-the-fly Java syntax checking in vim

Tags:

java

syntax

vim

First and foremost please don't scream "Use an IDE" at me. I have given eclipse a chance and it is... okay but I'm much faster in vim than eclipse.

Basically the one thing that I wish vim could do that eclipse does is syntax checking on the fly. In eclipse if you have a syntax error the line is given an error marker and the file-name at the top shows a little red thing to let you know there are errors. I have been trying to get this in vim. I've looked at syntastic (which doesn't have checkers for Java) but I can't seem to make it work. So the question remains...

Is there any way to check syntax every time I save a file with vim? Hopefully have it show up in the status line naming how many errors and what line the first error is on...

like image 326
CaldwellYSR Avatar asked Nov 28 '11 17:11

CaldwellYSR


1 Answers

I realise this already has an accepted solution but vim purists might prefer to use Syntastic

It comes pre-configured for many of the common languages like PHP, Java etc. Just thought I'd leave this here in case other people have the same question but don't want to run a headless eclipse server to achieve it.

like image 127
Troy Patrick Avatar answered Sep 28 '22 10:09

Troy Patrick