sponsor Vim development Vim logo Vim Book Ad

jsflakes.vim : A powerful vim plugin lint javascript code on the fly

 script karma  Rating 25/7, Downloaded by 502    Comments, bugs, improvements  Vim wiki

created by
yf liu
 
script type
ftplugin
 
description
Watch live video: http://michalliu.github.com/jsflakes.vim/jsflakes.html

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

If you don't like this behaviour. You can toggle the Automatic Lint by <Leader>al , your vim's <Leader> is often \.

The command to run jshint manaually is

:JSHint

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

RunJS

:RunJS   run javascript code
RunJSBlock

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

:RunHtml   run html code
RunHtmlBlock

:RunHtmlBlock 1,2  run html code from line 1 to line 2
 
install details
this plugin requires jsruntime http://www.vim.org/scripts/script.php?script_id=4050 and jsoncodecs http://www.vim.org/scripts/script.php?script_id=4056 installed

put jsflakes to $VIM/ftplugin

you should enable file type plugin by add following lines to your vimrc

filetype on
filetype plugin on
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
jsflakes.zip 1.5 2012-05-27 7.0 yf liu switch to use linux line endings
jsflakes.zip 1.4 2012-05-24 7.0 yf liu sometimes It's very annoying when automatic lint is enabled, now you can toggle the auto lint by <Leader>al
this version aslo fix some encoding errors
jsflakes.zip 1.3 2012-05-21 7.0 yf liu switch to use location list instead of quick fix, thanks Doug McInnes
jsflakes.zip 1.2 2012-05-15 7.0 yf liu 1. update jslint to latest
2. improve user exprience
3. handle HTML parse exception
jsflakes.zip 1.1 2012-05-11 7.0 yf liu fix unix path issue
jsflakes.zip 1.0 2012-05-10 7.0 yf liu repacking
ip used for rating: 107.21.187.131

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo