Node.js must be in your path.
If you're old school or not into pathogen, there is a Makefile to copy everything into your
Add to vimrc:
And install it:
:so ~/.vimrc :PluginInstall
git clone https://github.com/wookiehangover/jshint.vim.git ~/.vim/bundle/jshint.vim
To disable automatic checking and only check when the file is written, use the following in your ~/.vimrc or set it at runtime:
Manually check the file
Toggle automatic checking of a file
This can also be set in the
~/.vimrc file to bind this command to a key or to turn off error checking by default:
Working with quickfix
When automatic error checking is enabled, jshint.vim will automatically display errors in the quickfix window in addition to highlighting them.
You can open and close the quickfix window with the commands
:cclose. Use the command
:cn to go to the next error or
:cc [nr] to go to a specific error, where
[nr] is a number. The first error in the list is
1, the second is
2, and so on.
Once an error is fixed the corresponding quickfix line will disappear.
Disable error highlighting
let g:JSHintHighlightErrorLine = 0
Add any valid JSHint options to a
/*jshint browser: true, laxcomma, true, asi: true */ /*global deepEqual, equal, notEqual, test, ok, raises */