Code Monkey home page Code Monkey logo

javascript-libraries-syntax.vim's Introduction

javascript-libraries-syntax.vim

Syntax file for JavaScript libraries. Supports JavaScript libraries I am using (patches welcome). Should works well with other JavaScript syntax file. SyntaxComplete also works well on all supported languages.

Libraries

File Types

Will be more when SyntaxComplete has new version.

Install

Use pathogen or vundle is recommended.

Config

You can use g:used_javascript_libs to setup used libraries, ex:

let g:used_javascript_libs = 'underscore,backbone'

Support libs id:

  • jQuery: jquery
  • underscore.js: underscore
  • Lo-Dash: underscore
  • Backbone.js: backbone
  • prelude.ls: prelude
  • AngularJS: angularjs
  • AngularUI: angularui
  • AngularUI Router: angularuirouter
  • React: react
  • Flux: flux
  • RequireJS: requirejs
  • Sugar.js: sugar
  • Jasmine: jasmine
  • Chai: chai
  • Handlebars: handlebars

Default lib set is: jquery,underscore,backbone

You can use local vimrc to setup libraries used in project. Sample code for local vimrc:

autocmd BufReadPre *.js let b:javascript_lib_use_jquery = 1
autocmd BufReadPre *.js let b:javascript_lib_use_underscore = 1
autocmd BufReadPre *.js let b:javascript_lib_use_backbone = 1
autocmd BufReadPre *.js let b:javascript_lib_use_prelude = 0
autocmd BufReadPre *.js let b:javascript_lib_use_angularjs = 0

Todo

  • Support future version of SyntaxComplete

Known Issue

SyntaxComplete only accept groups with filetype prefixed. For example, 'javascript' files. Only keywords in groups which's name matches /javascript.*/ will be available. So to make it possible to use SyntaxComplete on CoffeeScript, LiveScript and other compile to JavaScript languages. We must redefine all syntax many times, with different name prefix. SyntaxComplete might have new feature to support a user define pattern for group name to include. All repeat defination will be removed when SyntaxComplete supports this feature.

Changes

Version 0.4

  • Add React, Flux, Chai, Handlbars
  • Default lib set
  • Bug fix

Version 0.3.6

  • Add Jasmine, AngularUI
  • Update underscore, jQuery

Version 0.3.5

  • Add sugar.js support
  • b:current_syntax to detect current syntax

Version 0.3.4

  • Add $ to iskeyword for jQuery and angular (Issue #4)
  • Support linecomment (Issue #6)
  • Add augularjs HTML custom attribute support

Version 0.3.3

  • No strict mode, better compatibility.

Version 0.3.2

  • Fix coffee script compatible
  • Update jQuery syntax to latest version
  • Support lo-dash
  • jQuery selector update
  • Minor bug fix

Version 0.3.1

  • Fix performance issue

Version 0.3

  • Supports AngularJS, RequireJS
  • Support TypeScript
  • Setup used libraries
  • Better init way

Version 0.2

  • Supports library selection

Version 0.1

  • First release.

Credits

License

Copyright (c) 2013 Wei-Ko Kao

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

javascript-libraries-syntax.vim's People

Contributors

othree avatar tlvince avatar pgilad avatar rafabene avatar watagashi avatar

Watchers

James Cloos avatar  avatar

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.