How Do I get a syntax check to work in/with vim?

admin

Administrator
Staff member
This question has been asked, in one form or another, a dozen times here, and it blows my mind how not a single one actually addresses how to configure <a href="http://www.vim.org/scripts/script.php?script_id=2736" rel="nofollow noreferrer">syntastic</a> or <a href="http://www.jslint.com/" rel="nofollow noreferrer">jslint</a> such that it actually does what it is supposed to do (its README file is completely useless)

<a href="https://stackoverflow.com/questions/3319211/cant-get-syntastic-vim-plugin-to-work">see here</a>

Can anyone provide some step by step instructions, or a link to such instructions. I tried to install jslint and spidermonkey, and I got nowhere.

<hr>

I managed to get the syntax check to work (thanks to romainl). A few things I learned along the way that may help anyone with a similar problem

<ol>
<li>To build <a href="http://www.javascriptlint.com/" rel="nofollow noreferrer">Javascript Lint</a> look for the README file nested in
Code:
jsl-x.x.x/src/README.html
</li>
<li>The build instructions are
Code:
gmake -f Makefile.ref
but
Code:
gmake
is the <a href="http://ubuntuforums.org/showthread.php?t=389841" rel="nofollow noreferrer">same thing</a> as
Code:
make
so issue the command
Code:
sudo ln -s /usr/bin/make /usr/bin/gmake
</li>
<li>jsl will now be found in
Code:
jsl-0.3.0/src/Linux_All_DBG.OBJ/jsl
. To make it generally accessible do something like:
Code:
ln -s /whatever/jsl-0.3.0/src/Linux_All_DBG.OBJ /home/ForestGump/bin/jsl
. More information <a href="http://ioconnor.wordpress.com/2009/05/02/javascriptlint-vim-and-ubuntu/" rel="nofollow noreferrer">here</a></li>
<li>To check that jsl actually works find a test file ( <a href="http://www.w3schools.com/js/tryit.asp?filename=tryjs_externalexample" rel="nofollow noreferrer">here</a>) then issue the command
Code:
jsl -process test.js
. It should list all the errors.</li>
<li>To customize your command line, add this to your vimrc file
Code:
set statusline=%{SyntasticStatuslineFlag()}
</li>
</ol>