Reputation: 16752
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 syntastic or jslint such that it actually does what it is supposed to do (its README file is completely useless)
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.
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
jsl-x.x.x/src/README.html
gmake -f Makefile.ref
but gmake
is the same thing as make
so issue the command sudo ln -s /usr/bin/make /usr/bin/gmake
jsl-0.3.0/src/Linux_All_DBG.OBJ/jsl
. To make it generally accessible do something like: ln -s /whatever/jsl-0.3.0/src/Linux_All_DBG.OBJ /home/ForestGump/bin/jsl
. More information herejsl -process test.js
. It should list all the errors.set statusline=%{SyntasticStatuslineFlag()}
Upvotes: 4
Views: 2928
Reputation: 8270
Setup vundle according to its README.
Put this into your .vimrc:
Bundle 'scrooloose/syntastic'
Then enter this command in vim:
:BundleInstall
That's it.
EDIT: Vundle has changed its syntax since I originally wrote this. Nowadays, you use
Plugin 'scrooloose/syntastic'
and then enter
:PluginInstall
Upvotes: 2
Reputation: 196476
What did you do? What works and what doesn't? Do you get error messages?
Here is what I did:
jsl
sources from the JavaScript Lint site.jsl
and moved it somewhere in my $PATH
.:helptags /path/to/syntastic/doc
because for some reason Pathogen's automatic help tags generation doesn't work for me.:help syntastic
.Steps 1 to 5 didn't take more than 3 or 4 minutes, maybe less.
Step 6 is obligatory, whatever new tool you try. RTFM.
I didn't have to configure anything beside these 3 lines in my .vimrc (and I believe the third is redundant):
let g:syntastic_auto_loc_list=1
let g:syntastic_disabled_filetypes=['html']
let g:syntastic_enable_signs=1
and customizing my statusline a bit with:
%{SyntasticStatuslineFlag()}
EDIT
Here is my statusline:
set statusline=%<\ %n:%f\ %m%r%y%{SyntasticStatuslineFlag()}%=line:\ %l\ of\ %L,\ col:\ %c%V,\ win:\ %{WindowNumber()}\
Don't copy it verbatim or you'll get some errors due to the function call at the end. There is a paragraph about that in syntastic's help.
END EDIT
After all that, 10 or 12 minutes if you count reading the documentation, I have a very helpful location list and signs poping up each time I save a .js file with syntax errors.
Upvotes: 2