vim-jshint


Ⅰ. 插件描述

A plugin that allow you to run jshint from vim.

Ⅱ. 基本信息

创建日期:  2011-10-25
使用用户:  6
Github星:  29
插件作者:  Steffen Leistner

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'sleistner/vim-jshint'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'sleistner/vim-jshint'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'sleistner/vim-jshint'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/sleistner/vim-jshint

Ⅳ. 文档说明

# vim-jshint

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

<img src="http://sleistner.github.com/vim-jshint/images/screenshot.png"
alt="vim-jshint screenshot" width="829" height="581" />

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:

添加新评论