Skip to content

bigfish/vim-nodelint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Vim compiler plugin to run nodelint on Javascript files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published