vim-nodelint


Ⅰ. 插件描述

Vim compiler plugin to run nodelint on Javascript files

Ⅱ. 基本信息

创建日期:  2011-11-28
使用用户:  2
Github星:  6
插件作者:  David Wilhelm

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

## Vim Nodelint

A vim compiler plugin to run nodelint.

Installation

  1. Install nodejs
  2. Install npm
  3. Install nodelint:

    sudo npm install -g nodelint@0.6.0

  4. Put the nodelint.vim plugin from the compiler folder into your .vim/compiler folder (create it if it does not exist)
  5. Add the following to .vim/after/ftplugin/javascript:

    compiler nodelint

After you open a .js file, and save it, it will run nodelint on the file and report errors in the location window.
It will jump to the location of the first error.

_NB_: The environment variable $NODE_PATH must be set to the location(s) of your node modules. NPM does this automatically on the Mac,
but does not do it on Linux, apparently. You can discover this by a command like 'locate nodelint'.
It will be something like '/usr/local/lib/node_modules'. Set this in your .bashrc like so:

export NODE_PATH=/usr/local/lib/node_nodules

Options

Config File

The plugin will search for a file called 'nodelint-config.js' in the directories above the current
file, and use the first one it finds.

Otherwise it will use the default config file for nodelint -- see the nodelint-config.js included as
an example. (The given example is configured for use in a browser environment, not Node.js, which is
the default).

If you set the g:NodelintConfig option, it will override any others and apply globally.
eg.

let g:NodelintConfig = $HOME . '/nodelint-config.js'

If you wish to not have the plugin auto-jump to errors, or open the window, set the following in
your .vimrc:

let g:NodelintPassive = 1

Then you can open the location window with :lope (and close with :lcl)

添加新评论