GithubHelp home page GithubHelp logo

jsflakes.vim's Introduction

jsflakes.vim

A powerful vim plugin lint javascript code on the fly. It supports Windows/Linux/Mac up to Vim 8.0

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.

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

You can aslo disable autolint by adding let g:jsflakes_autolint = 0 to your vimrc.

The command to run jshint manaually is :JSLint.

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 in 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
    

jsflakes.vim's People

Contributors

michalliu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

jsflakes.vim's Issues

error on load

I got an error on load when start vim with a js source file:

Error detected while processing /home/pi/.vim/vimpyre/jsflakes.vim/ftplugin/javascript/jsflakes.vim:
line 19:
jsruntime.vim is required, plz visit http://www.vim.org/scripts/script.php?script_id=4050

and the scriptnames output are:

1: /usr/share/vim/vimrc
2: /usr/share/vim/vim73/debian.vim
3: ~/.vimrc
4: /usr/share/vim/vim73/ftoff.vim
5: ~/.vim/autoload/pathogen.vim
6: ~/.vim/vimpyre/jsruntime.vim/autoload/javascript/runtime.vim
7: /usr/share/vim/vim73/syntax/syntax.vim
8: /usr/share/vim/vim73/syntax/synload.vim
9: /usr/share/vim/vim73/syntax/syncolor.vim
10: /usr/share/vim/vim73/filetype.vim
11: /usr/share/vim/vim73/ftplugin.vim
12: /usr/share/vim/vim73/indent.vim
13: ~/.vim/vimpyre/vim-colorschemes/colors/satori.vim
14: ~/.vim/vimpyre/jsoncodecs.vim/plugin/jsoncodecs.vim
15: /usr/share/vim/vim73/plugin/getscriptPlugin.vim
..
25: /usr/share/vim/vim73/syntax/javascript.vim
26: ~/.vim/vimpyre/jsflakes.vim/ftplugin/javascript/jsflakes.vim
27: /usr/share/vim/vim73/ftplugin/javascript.vim
28: /usr/share/vim/vim73/indent/javascript.vim

any idea?

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.