A plugin that allow you to run jshint from vim.
VimL JavaScript Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
plugin/jshint
.gitignore
README.md

README.md

vim-jshint

A vim plugin that automatically run jshint on the current buffer.

vim-jshint screenshot

Usage

The content of the current buffer will be passed to the javascript jshint parser after the buffer is saved. Lint warnings will be shown in the quickfix error window.

Installation

Plugin

If you don't have a preferred installation method, I recommend installing pathogen.vim, and then simply copy and paste:

cd ~/.vim/bundle
git clone git://github.com/sleistner/vim-jshint.git

JavaScript runtime

Mac OS X

No additional installation steps required /System/Library/Frameworks/JavaScriptCore.framework/Resources/jsc is used by default.

Linux

Install SpiderMonkey

$ sudo apt-get install spidermonkey-bin

Options

.jshintrc option files in your home and current directory will be loaded automatically.

Those files should be in JSON format. See JSHint docs for more information about option names and values.

Example:

{
    "expr": true,
    "boss": true
}

Commands

  • :JSHint run jshint for current file

  • :JSHintReload reload all .jshintrc option files.

  • :JSHintToggle enable or disable jshint validation

Credits

This plugin makes heavy use of the following sources: