dmcinnes / jsflakes.vim

A powerful vim plugin lint javascript code on the fly

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsflakes.vim

A powerful vim plugin lint javascript code on the fly. watch video

Install

  1. You need install jsruntime first

  2. You need install jsoncodecs first

  3. Copy everything inside ftplugin to your vimfiles/ftplugin directory

  4. Add following lines to your vimrc

     filetype on
     filetype plugin on
    

Usage

For javascript file, jsflakes will automaticlly check errors in your code while you editing.

The current errors are added to the window's location list. You can aslo use quickfix commands, like

:lli list errors in your javascript code
:lopen open location window

Advance Usage

Jsflakes aslo support html file, add following to your vimrc

au FileType html source $VIM\vimfiles\ftplugin\javascript\jsflakes.vim

Jsflakes use jslint to check errors. Jslint has many options, Jslint option file should be at ~/.jshintrc by default. your can change it to other location by adding following line to your vimrc

let g:jshint_rcfile = {PATH}

Jsflakes aslo provide commands to run javascript directly inside VIM

  1. RunJS

     :RunJS   run javascript code
    
  2. RunJSBlock

     :RunJS 1,2  run javascript code from line 1 to line 2
    
  3. RunHtml

     :RunHtml   run html code
    
  4. RunHtmlBlock

     :RunHtmlBlock 1,2  run html code from line 1 to line 2
    

About

A powerful vim plugin lint javascript code on the fly


Languages

Language:JavaScript 94.3%Language:Vim Script 5.7%