Fortunately enough, people have been working hard across the intertubes, and developed wonderful, although some partially-working ways to do just that.
Here’s the step-by-step tutorial you’ve been waiting for:
- Install Syntastic Vim plugin - Best syntax-checker around for plenty of languages, plus it integrates with Vim’s location-list (==quickfix) window. I recommend cloning from the GitHub repo and installing using a plugin manager like Vundle or Pathogen, since it’s more frequently updated.
- Choose one of the two options below:
- Install node.js using your favorite package manager.
- Install NPM (Node Package Manager).
npm install jshint -g
- Put your jshint config file in your $HOME dir:
~/.jshintrc. Here’s JSHint-Node’s example configuration file, they pulled from mine and added more stuff. Here’s my original copy, which you can also start from.
- The steps are the same, except you need to insteall the
jslpackage instead of
For more info check this question on StackOverflow for the discussion regarding the above solutions.
Source code browsing
This is a more complicated matter.
There was a project by Mozilla called DoctorJS, formerly called jsctags, which is now abandoned. However, it’s still in working shape, and you can check the repo’s issues page for some bandaging. Here’s how to install it:
- Install the
exuberant-ctagspackage, via your OS package manager (brew, apt-get, etc.). Just make sure you install exuberant-ctags.
- Install node.js.
DoctorJSfrom github: git clone https://github.com/mozilla/doctorjs.git
- Go inside
make install(You’ll also need to use
maketo install). There might be problems with installing the program, as it looks like
make installdoesn’t do the trick for the moment. For now I just add the repo’s
bin/dir to my $PATH instead. See DoctorJS’s GitHub and issues pages for more info.
- Install the TagBar Vim plugin (It’s TagBar, not the old infamous TagList!).
There’s a new promising project called Tern. It’s currently in beta, and should eventually replace it. The developer is working on integrating it with ctags, thus with tagbar and vim. Stay tuned using the attached links.
jsctags for Tern
At last somebody set up a Tern-to-ctags converter for public use.
The next and final step is called PROFIT. Enjoy!