Giter Site home page Giter Site logo

vim-jslint's Introduction

vim-jslint

vim-jslint is a Vim plugin that runs the currently open file through JSLint, a static syntax and style checker for JavaScript source code.

This is mainly inspired by the great vim-flake8 plugin, that runs the currently open file through Flake8

Installation

Install JSLint via npm:

npm install jslint -g

Use vundle if you're not using it already. Then, simply put

Bundle 'sweh/vim-jslint'

into your ~/.vimrc and run:

:so ~/.vimrc
:BundleInstall

Usage

  1. Open a JavaScript file
  2. Press <F7> to run jslint on it

It shows the errors inside a quickfix window, which will allow your to quickly jump to the error locations by simply pressing [Enter].

Customization

If you don't want to use the <F7> key for jslint-checking, simply remap it to another key. It autodetects whether it has been remapped and won't register the <F7> key if so. For example, to remap it to <F3> instead, use:

autocmd FileType javascipt map <buffer> <F3> :call JSLint()<CR>

To customize the location of your jslint binary, set g:jslint_cmd:

let g:jslint_cmd="/opt/strangebin/jslint000"

Tips

A tip might be to run the JSLint check every time you write a JavaScript file, to enable this, add the following line to your .vimrc file (thanks Godefroid!):

autocmd BufWritePost *.js call JSLint()

History

1.0: Initial version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.