Last Updated: February 25, 2016
·
1.62K
· mateuszgachowski

jshint in VIM

I was requested to provide the same configuration for jshint in VIM as I provided for Sublime Text 3, so lets do it! ;)

  1. Hopefully you have pathogen.vim installed, if not Click here and go through all steps
  2. Go to the bundle directory (~/.vim/bundle/) and get the repo from git: git clone https://github.com/scrooloose/syntastic.git
  3. Restart vim and fire :Helptags command. If you get any errors, try to check if you have installed pathogen correctly.
  4. Open a javascript file and fire command: :SyntasticInfo. If you have any jshint or jslint installed, you should see something similar to this:
Syntastic: active mode enabled
Syntastic info for filetype: javascript
Available checker(s): jshint
Currently enabled checker(s): jshint

If you have no checkers, then you probably don't have jshint installed. Try install jshint globally, for example using npm:
npm install -g jshint and restarting VIM

  1. If everything went well and if any error appears, you should see two arrows on the left, just near the line number: VIM jshint error and at the bottom of VIM you should see what the error is about:

Expected '(' to have an indentation at 1 instead at 3.

Now you can enjoy your jshint in VIM ;)

1 Response
Add your response

Well done Mateusz! Thanks for the tip!

over 1 year ago ·